Part Number Hot Search : 
WF121000 JX5822 MAX170 BSP152 170HSR ICS83021 TM1721 00SERI
Product Description
Full Text Search
 

To Download TMPM380FWDFG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  32-bit tx system risc tx03 series tmpm380fydfg TMPM380FWDFG tmpm380fyfg tmpm380fwfg tmpm382fwfg tmpm382fsfg semiconductor company
revision history date revision 2011/3/17 rev 1 first release
tmpm380/m382 tmpm380/m380 - 1 / 7 - *************************************************************************************************************** arm, arm powered, amba, ad k, arm9tdmi, tdmi, primecell, realview, thumb, cortex, coresight, arm9, arm926ej-s, embedded trace ma crocell, etm, ahb, apb, and keil are registered trademarks or trademarks of arm limited in the eu and other countries. **************************************************************************************************************** ?
1 over and features tmpm380/m382 tmpm380/m382 - 2 / 7 - comparison table ? tmpm382fwfg tmpm382fsfg tmpm380fyfg/dfg tmpm380fwfg/dfg (1) processor core arm cortex-m3 (2) interrupt sources - internal: 55 factors - external: 8 factors int0/1/2/3/4/5/8/f - internal: 77 factors - external: 16 factors int0-f (3) input/output ports 48 pins - input/output: 47 pins - output: 1pin 84 pins - input/output: 83 pins - output: 1pin (4) watchdog timer (wdt) 1 channel (5) power-on reset circuit (por) 1 channel (6) voltage detection circuit (vltd) 1 channel (7) oscillation frequency detector (ofd) 1 channel (8) dma contorller 2 channels (9) encoder input circuit (enc) 2 channels (10) 16-bit multi purpose timer (mpt) 1 channel ch0 3 channels ch0-2 (11) 16-bit timer (tmrb) 8 channels ch0-7 (ch3,5:16bit interval timer mode only) 8 channels ch0-7 (12) real time clock (rtc) 1 channel (13) serial channel (uart/sio) 3 channels ch0/1/4 5 channels ch0-4 (14) serial bus interface (i2c/sio) 1 channel ch0 2 channels ch0-1 (15) synchronous serial port (ssp) 1 channel ch0 2 channels ch0-1 (16) remote control signal preprocesser (rmc) 1 channel (17) 12-bit a/d converter (adc) 1unit - 10 channels ch0-9 1unit - 18 channels ch0-17 (18) standby mode - standby modes: idle, sleep and stop - sub clock operation (32.768khz): slow, sleep (19) clock generator(cg) 1 channel (20) endian little endian (21) maximum operating frequency 40mhz (22) operating voltage range 4.0v~5.5v (with on-chip regulator) (23) temperature range -40c~85c (except during flash writing/ erasing and debugging) 0c~70c (during flash writing/ erasing and degugging)
tmpm380/m382 tmpm380/m382 - 3 / 7 - 32-bit risc microcontroller tx03 series tmpm380fyfg, tmpm380fwfg tmpm380fydfg, TMPM380FWDFG tmpm382fwfg, tmpm382fsfg tx03 series is a 32-bit risc microcontroller series with an arm ? cortex?-m3 microcontroller core. product no. on chip flash rom on chip ram package tmpm380fyfg 256 kbyte 16 kbyte lqfp100-p-1414-0.50h tmpm380fydfg 256 kbyte 16 kbyte qfp100-p-1420-0.65q tmpm380fwfg 128 kbyte 12 kbyte lqfp100-p-1414-0.50h TMPM380FWDFG 128 kbyte 12 kbyte qfp100-p-1420-0.65q tmpm382fwfg 128 kbyte 12 kbyte qfp64-p-1414-0.80c tmpm382fsfg 64 kbyte 8 kbyte qfp64-p-1414-0.80c 1.1 features (1) arm cortex-m3 microcontroller core 1) improved cod e efficiency has been realized through the use of thumb ? -2 instruction - new 16-bit thumb ? instructions for improved program flow - new 32-bit thumb instructions for improved performance - auto-switching between 32-bit instruction and 16-bit instruction is executed by compiler. 2) both high performance and low power consumption have been achieved ? high performance - a 32-bit multiplication (3232=32 bi t) can be executed with one clock - division takes between 2 and 12 cycles depending on dividend and devisor ? low power consumption - optimized design using a low power consumption library - standby function that stops the operat ion of the microcontroller core 3) high-speed interrupt response suitable for real-time control - an interruptible long instruction - stack push automatically handled by hardware (2) interrupt sources - internal: 77 fa ctors?t he order of precedenc e can be set over 7 levels (except nmi). - external: 16 factors?the order of precedence can be set over 7 levels (3) input/output ports 84 pins - input/output: 83 pin s output: 1pin (4) watchdog timer (wdt): 1 channel - bina ry cou nter :under development
1 over and features tmpm380/m382 tmpm380/m382 - 4 / 7 - (5) power-on reset circuit (por) (6) v o ltage detection circuit (vltd) (7) oscillation f r equency detector (ofd) (8) dma contorll er: 2 channels - inc r to incr / incr to no-incr / no-incr to incr / no-incr to no-incr - 4word fifo buffer for each channel *2ch - scatter/gather transmission support (9) encoder input circuit (enc): 2 channels - co rre spond to increamental encoder(ab/abz) - rotation direction detecttion - counter for absolute position detection - comparator for position detection - noise filter - 3 phase sensor input (10) 16-bit multi purpose timer (mpt) : 3 channels cha nnel 0/1: suppo rted for pmd fucntion / igbt function / 16bit timer function channle 2: supported for igbt function / 16bit timer function pmd function - 3-phase pwm waveforms with the same pwm frequency - synctrigger signals to the ad converter - the protection circuit controls in emergency igbt function - 16-bit ppg output (two output pins) - external-triggered start and stop - the protection circuit controls in emergency 16bit timer function - 16-bit interval timer mode - 16-bit event counter mode - 16-bit ppg output (one output pin) - input capture function (11) 16-bit timer (tmrb): 8 channels - 16-bit interval timer mode - 16-bit event counter mode - 16-bit ppg output - external trigger programmable square-wave output mode (ppg) - timer synchronous mode - input capture function (12) real time clock (rtc) - clo ck (hour, minute and second) - calender (month, week, date and leap year) - alarm (alarm output) - alarm interruption (13) serial channel (uart/sio): 5 channels - either ua rt mode o r synchronous mode can be selected (4byte fifo equipped)
tmpm380/m382 tmpm380/m382 - 5 / 7 - (14) serial bus interface (i2c/sio): 2 channels - either i2c bus mod e or synchronous mode can be selected (15) synchronous serial port (ssp): 2 channels - spi flame format /ssi flame format /mic rowire flame format - 16byte fifo equipped (16bit*8) (16) remote control signal preprocesser (rmc) : 1 channel - can re ceive up to 72bit data at a time (17) 12-bit a/d converter (adc): 1unit (18 channels for analog input) - start by the intern al trigge r: tmrb interrupt / pmd trigger - 3 conversion mode(trigger start,so ftware start,constant conversion) arbitrary ain can be selected - ad conversion result register (12ch) - ad conversion monitoring function (2ch) - conversion speed 2.0usec (@ adc conversion clock = 40mhz) (18) standby mode - s t andby modes: idle, sleep and stop - sub clock operation (32.768khz): slow, sleep (19) clock generator(cg) - external osci illator (high f req. 10mhz x?ta l/ceramic) or on-chi p oscillator (9mhz) - external oscillator (low freq. 32khz x?tal) - on-chip pll (4 times) - clock gear function: the high-speed clock can be divided into 1/1, 1/2, 1/4, 1/8, 1/16 (20) endian - little endian (21 ) maximum operating frequency - 40m hz (22 ) operating voltage range - 4.0v~5.5v (with on-chip re gulato r) (23) temperature range - -40 c~85c (except during flash writing/ erasing and debugging) - 0c~70c (during flash writing/ erasing and degugging)
1 over and features tmpm380/m382 tmpm380/m382 - 6 / 7 - 1.2 block diagram fig1-1 tmpm380 block diagram cortex-m3 cpu debug nvic bus bridge i-code d-code system ahb-bus-matrix (40mhz) io-bus mpt(3ch) tmrb(8ch) ssp(2ch) uart/sio(5ch) por ofd wdt rtc cg enc (2ch) adc(18ch) rmc (1ch) regulator 3.3v nano flash i/f ram i/f i/f boot rom 5v 1.5v high-speed oscillator pll i2c/sio(2ch) dmac(2ch) int. high-speed oscillator port a - p vltd low-speed oscillator
tmpm380/m382 tmpm380/m382 - 7 / 7 - fig1-1 tmpm382 block diagram cortex-m3 cpu debug nvic bus bridge i-code d-code system ahb-bus-matrix (40mhz) io-bus mpt(1ch) tmrb(8ch) ssp(1ch) uart/sio(3ch) por ofd wdt rtc cg adc(10ch) rmc (1ch) regulator 3.3v nano flash i/f ram i/f i/f boot rom 5v 1.5v high-speed oscillator pll i2c/sio(1ch) dmac(2ch) int. high-speed oscillator port a - p vltd low-speed oscillator
tmpm380/m382 tmpm380/m382 - 1 / 13 - 2 pin layout and pin functions this chapter describes the pin layout, pin names and pin functions of tmpm380fyfg, tmpm380fwfg, tmpm380fydfg,TMPM380FWDFG tmpm382fwfg and tmpm382fsfg. 2.1 pin layout (top view) fig.2-1 shows the pin layout of tmpm380fyfg and tmpm380fwfg. fig. 2-1 pin layout (tmpm380fxfg) tmpm380fyfg tmpm380fwfg 100pin (14x14) top view pd5/txd2 pd6/rxd2 pf4/encz1/rxd3 pf3/encb1/txd3 pf2/enca1/sclk3/cts3 pf1/tb7out/alarm pf0/tb7in pb7/trst pb6/tdi pb5/tdo/swv pb4/tck/swclk pb3/tms/swdio pb2/tracedata1 pb1/tracedata0 pb0/traceclk ftest3 pl0/boot dvdd5 dvss a vdd5 a vss pj7/ain17/intb pj6/ain16/inta pj5/ain15 pj4/ain14 pd4/sclk2/cts2 pd3/int9 pd2/encz0/intd pd1/encb0/tb5out pd0/enca0/tb5in/intc dvss pc7/mt0in/rxd4 pc6/emg0/gemg0 / txd4 pc5/z o 0/mtout10/mttb0in/sclk4/cts4 pc4/wo0/mtout00/mttb0out pc3/yo0/sp0fss pc2/vo0/sp0clk/sck0 pc1/xo0/sp0di/scl0/si0 pc0/uo0/sp0do/sda0/so0 dvdd5 pp1/xt2 pp0/xt1 pm1/x2 dvss pm0/x1 dvss pg0/uo1/sda1/so1 pg1/xo1/scl1/si1 pg2/vo1/sck1 pg3/yo1 pj3/ain13 pj2/ain12 pj1/ain11 pj0/ain10 pi1/ain9 pi0/ain8 ph7/ain7 ph6/ain6 ph5/ain5 ph4/ain4 ph3/ain3 ph2/ain2/int2 ph1/ain1/int1 ph0/ain0/int0 vout3 reset rvdd5 mode dvss pl2/intf pn7/mt2in/inte pn6/gemg2 pn5/mtout12/mttb2in pn4/mtout02/mttb2out pn3/sp1fss pg4/wo1/mtout01/mttb1out pg5/zo1/mtout11/mttb1in pg6/emg1/gemg1 pg7/mt1in pa0/tb0in/int3 pa1/tb0out/scout pa2/tb1in/int4 pa3/tb1out/rxin pa4/sclk1/cts1 pa5 /txd1/tb6out pa6/rxd1/tb6in pa7/tb4in/int8 pe0/txd0 pe1/rxd0 pe2/sclk0/cts0 pe3/tb4out dvdd5 pe4/tb2in/int5 pe5/tb2out dvss pe6/tb3in/int6 pe7/tb3out/int7 pn0/sp1do pn1/sp1di pn2/sp1clk 1 5 10 15 20 25 75 70 65 60 55 51 26 30 35 40 45 50 100 95 90 85 80 76
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 2 / 13 - fig.2-2 shows the pin layout of tmpm380fydfg and TMPM380FWDFG. fig. 2-2 pin layout (tmpm380fxdfg) 1 5 10 15 20 25 30 80 75 70 65 60 55 51 31 35 40 45 50 100 95 90 85 81 tmpm380fydfg TMPM380FWDFG 100pin (14x20) top view pf4/encz1/rxd3 pf3/encb1/txd3 pf2/enca1/sclk3/cts3 pf1/tb7out/alarm pf0/tb7in pb7/trst pb6/tdi pb5/tdo/swv pb4/tck / swclk pb3/tms/swdio pb2/tracedata1 pb1/tracedata0 pb0/traceclk ftest3 pl0/boot dvdd5 dvss a vdd5 a vss pj7/ain17/intb pd6/rxd2 pd5/txd2 pd4/sclk2/cts2 pd3/int9 pd2/encz0/intd pd1/encb0/tb5out pd0/enca0/tb5in/intc dvss pc7/mt0in/rxd4 pc6/emg0/gemg0 / txd4 pc5/zo0/mtout10/mttb0in/sclk4/cts4 pc4/wo0/mtout00/mttb0out pc3/yo0/sp0fss pc2/vo0/sp0clk/sck0 pc1/xo0/sp0di/scl0/si0 pc0/uo0/sp0do/sda0/so0 dvdd5 pp1/xt2 pp0/xt1 pm1/x2 dvss pm0/x1 dvss pg0/uo1/sda1/so1 pg1/xo1/scl1/si1 pg2/v1/sck1 pg3/yo1 pg4/wo1/mtout01/mttb1out pg5/zo1/mtout11/mttb1in pg6/emg1/gemg1 pj6/ain16/inta pj5/ain15 pj4/ain14 pj3/ain13 pj2/ain12 pj1/ain11 pj0/ain10 pi1/ain9 pi0/ain8 ph7/ain7 ph6/ain6 ph5/ain5 ph4/ain4 ph3/ain3 ph2/ain2/int2 ph1/ain1/int1 ph0/ain0/int0 vout3 reset rvdd5 mode dvss pl2/intf pn7/mt2in/inte pn6/gemg2 pn5/mtout12/mttb2in pn4/mtout02/mttb2out pn3/sp1fss pn2/sp1clk pn1/sp1di pg7/mt1in pa0/tb0in/int3 pa1/tb0out/scout pa2/tb1in/int4 pa3/tb1out/rxin pa4/sclk1/cts1 pa5 /txd1/tb6out pa6/rxd1/tb6in pa7/tb4in/int8 pe0/txd0 pe1/rxd0 pe2/sclk0/cts0 pe3/tb4out dvdd5 pe4/tb2in/int5 pe5/tb2out dvss pe6/tb3in/int6 pe7/tb3out/int7 pn0/sp1do
tmpm380/m382 tmpm380/m382 - 3 / 13 - fig.2-3 shows the pin layout of tmpm382fwfg and tmpm382fsfg. fig. 2-3 pin layout (tmpm382fxfg) tmpm382fwfg tmpm382fsfg 64pin (14x14) top view pf1/tb7out/alarm pf0/tb7in pb7/trst pb6/tdi pb5/tdo/swv pb4/tck/swclk pb3/tms/swdio pb2/tracedata1 pb1/tracedata0 pb0/traceclk ftest3 pl0/boot dvdd5 dvss a vdd5 a vss dvss pc7/mtin/rxd4 pc6/emg0/gemg0 / txd4 pc5/zo0/mtout10/mttb0in/sclk4/cts4 pc4/wo0/mtout00/mttb0out pc3/yo0/sp0fss pc2/vo0/sp0clk/sck0 pc1/xo0/sp0di/scl0/si0 pc0/uo0/sp0do/sda0/so0 dvdd5 pp1/xt2 pp0/xt1 pm1/x2 dvss pm0/x1 dvss pi1/ain9 pi0/ain8 ph7/ain7 ph6/ain6 ph5/ain5 ph4/ain4 ph3/ain3 ph2/ain2/int2 ph1/ain1/int1 ph0/ain0/int0 vout3 reset rvdd5 mode dvss pl2/intf pa0/tb0in/int3 pa1/tb0out/scout pa2/tb1in/int4 pa3/tb1out/rxin pa4/sclk1/cts1 pa5 /txd1/tb6out pa6/rxd1/tb6in pa7/tb4in/int8 pe0/txd0 pe1/rxd0 pe2/sclk0/cts0 pe3/tb4out dvdd5 pe4/tb2in/int5 pe5/tb2out dvss 1 5 10 15 48 45 40 35 17 20 25 30 32 64 60 55 50
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 4 / 13 - 2.2 pin function table 2-1 lists the pin functions of tmpm380fxfg/dfg. table 2-4 shows the operating voltage of each pin, and table 2-5 show s the volt age range of every pin. table 2-1 pin functions (1/5) m380fxdfg qfp100 m380fxfg lqfp100 pin name output during reset schimitt (o:yes) open drain mode 3 1 pd4 sclk2 cts2 hi-z o o 4 2 pd3 int9 hi-z o o 5 3 pd2 encz0 intd hi-z o o 6 4 pd1 encb0 tb5out hi-z o o 7 5 pd0 enca0 tb5in intc hi-z o o 8 6 dvss 9 7 pc7 mt0in rxd4 hi-z o o 10 8 pc6 emg0 gemg0 txd4 hi-z o o 11 9 pc5 zo0 mtout10 mttb0in sclk4 cts4 hi-z o o 12 10 pc4 wo0 mtout00 mttb0out hi-z o o 13 11 pc3 yo0 sp0fss hi-z o o 14 12 pc2 vo0 sp0clk sck0 hi-z o o 15 13 pc1 xo0 sp0di scl0 / si0 hi-z o o
tmpm380/m382 tmpm380/m382 - 5 / 13 - table 2-1 pin functions (2 /5) m380fxdfg qfp100 m380fxfg lqfp100 pin name output during reset schimitt (o:yes) open drain mode 16 14 pc0 uo0 sp0do sda0 / so0 hi-z o o 17 15 dvdd5 18 16 pp1 xt2 hi-z o o 19 17 pp0 xt1 hi-z o o 20 18 pm1 x2 hi-z o o 21 19 dvss 22 20 pm0 x1 hi-z o o 23 21 dvss 24 22 pg0 uo1 sda1 / so1 hi-z o o 25 23 pg1 xo1 scl1 / si1 hi-z o o 26 24 pg2 vo1 sck1 hi-z o o 27 25 pg3 yo1 hi-z o o 28 26 pg4 wo1 mtout01 mttb1out hi-z o o 29 27 pg5 zo1 mtout11 mttb1in hi-z o o 30 28 pg6 emg1 gemg1 hi-z o o 31 29 pg7 mt1in hi-z o o 32 30 pa0 tb0in int3 hi-z o o 33 31 pa1 tb0out scout hi-z o o 34 32 pa2 tb1in int4 hi-z o o 35 33 pa3 tb1out rxin hi-z o o
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 6 / 13 - table 2-1 pin functions (3 /5) m380fxdfg qfp100 m380fxfg lqfp100 pin name output during reset schimitt (o:yes) open drain mode 36 34 pa4 sclk1 cts1 hi-z o o 37 35 pa5 txd1 tb6out hi-z o o 38 36 pa6 rxd1 tb6in hi-z o o 39 37 pa7 int8 tb4in hi-z o o 40 38 pe0 txd0 hi-z o o 41 39 pe1 rxd0 hi-z o o 42 40 pe2 sclk0 cts0 hi-z o o 43 41 pe3 tb4out hi-z o o 44 42 dvdd5 45 43 pe4 tb2in int5 hi-z o o 46 44 pe5 tb2out hi-z o o 46 45 dvss 48 46 pe6 tb3in int6 hi-z o o 49 46 pe7 tb3out int7 hi-z o o 50 48 pn0 sp1do hi-z o o 51 49 pn1 sp1di hi-z o o 52 50 pn2 sp1clk hi-z o o 53 51 pn3 sp1fss hi-z o o 54 52 pn4 mtout02 mttb2out hi-z o o 55 53 pn5 mtout12 mttb2in hi-z o o 56 54 pn6 gemg2 hi-z o o
tmpm380/m382 tmpm380/m382 - 7 / 13 - table 2-1 pin functions (4 /5) m380fxdfg qfp100 m380fxfg lqfp100 pin name output during reset schimitt (o:yes) open drain mode 57 55 pn7 mt2in inte hi-z o o 58 56 pl2 intf hi-z o o 59 57 dvss 60 58 mode hi-z o 61 59 rvdd5 62 60 reset pull up o 63 61 vout3 vout3 64 62 ph0 ain0 int0 hi-z o o 65 63 ph1 ain1 int1 hi-z o o 66 64 ph2 ain2 int2 hi-z o o 67 65 ph3 ain3 hi-z o o 68 66 ph4 ain4 hi-z o o 69 67 ph5 ain5 hi-z o o 70 68 ph6 ain6 hi-z o o 71 69 ph7 ain7 hi-z o o 72 70 pi0 ain8 hi-z o o 73 71 pi1 ain9 hi-z o o 74 72 pj0 ain10 hi-z o o 75 73 pj1 ain11 hi-z o o 76 74 pj2 ain12 hi-z o o 77 75 pj3 ain13 hi-z o o 78 76 pj4 ain14 hi-z o o 79 77 pj5 ain15 hi-z o o 80 78 pj6 ain16 inta hi-z o o 81 79 pj7 ain17 intb hi-z o o
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 8 / 13 - table 2-1 pin function (5/ 5 ) m380fxdfg qfp100 m380fxfg lqfp100 pin name output during reset schimitt (o:yes) open drain mode 82 80 avss 83 81 avdd5 84 82 dvss 85 83 dvdd5 86 84 pl0 boot pull up o 87 85 ftest3 hi-z(note) 88 86 pb0 traceclk hi-z o o 90 87 pb1 tracedata0 hi-z o o 90 88 pb2 tracedata1 hi-z o o 91 90 pb3 tms swdio pull up o o 92 90 pb4 tck swclk pull down o o 93 91 pb5 tdo swv hi-z o o 94 92 pb6 tdi pull up o o 95 93 pb7 trst pull up o o 96 94 pf0 tb7in hi-z o o 97 95 pf1 tb7out alarm hi-z o o 98 96 pf2 enca1 sclk3 cts3 hi-z o o 99 97 pf3 encb1 txd3 hi-z o o 100 98 pf4 encz1 rxd3 hi-z o o 1 99 pd6 rxd2 hi-z o o 2 100 pd5 txd2 hi-z o o (note) open : don?t connect any circuit. this pin use for internal test only.
tmpm380/m382 tmpm380/m382 - 9 / 13 - table 2-2 lists the pin functions of tmpm382fxfg. table 2-4 show s the operating voltage of each pin, and table 2-5 show s the voltage range of every pin. table 2-2 pin functions (1/4) pin no. pin name output during reset schimitt (o:yes) open drain mode 1 dvss 2 pc7 mtin rxd4 hi-z o o 3 pc6 emg0 gemg0 txd4 hi-z o o 4 pc5 zo0 mtout10 mttb0in sclk4 cts4 hi-z o o 5 pc4 wo0 mtout00 mttb0out hi-z o o 6 pc3 yo0 sp0fss hi-z o o 7 pc2 vo0 sp0clk sck0 hi-z o o 8 pc1 xo0 sp0di scl0 / si0 hi-z o o 9 pc0 uo0 sp0do sda0 / so0 hi-z o o 10 dvdd5 11 pp1 xt2 hi-z o o 12 pp0 xt1 hi-z o o 13 pm1 x2 hi-z o o 14 dvss 15 pm0 x1 hi-z o o 16 dvss
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 10 / 13 - table 2-3 pin functions (2/4) pin no. pin name output during reset schimitt (o:yes) open drain mode 17 pa0 tb0in int3 hi-z o o 18 pa1 tb0out scout hi-z o o 19 pa2 tb1in int4 hi-z o o 20 pa3 tb1out rxin hi-z o o 21 pa4 sclk1 cts1 hi-z o o 22 pa5 txd1 tb6out hi-z o o 23 pa6 rxd1 tb6in hi-z o o 24 pa7 int8 tb4in hi-z o o 25 pe0 txd0 hi-z o o 26 pe1 rxd0 hi-z o o 27 pe2 sclk0 cts0 hi-z o o 28 pe3 tb4out hi-z o o 29 dvdd5 30 pe4 tb2in int5 hi-z o o 31 pe5 tb2out hi-z o o 32 dvss
tmpm380/m382 tmpm380/m382 - 11 / 13 - table 2-2 pin function s (3/ 4) pin no. pin name output during reset schimitt (o:yes) open drain mode 33 pl2 intf hi-z o o 34 dvss 35 mode hi-z o 36 rvdd5 37 reset pull up o 38 vout3 vout3 39 ph0 ain0 int0 hi-z o o 40 ph1 ain1 int1 hi-z o o 41 ph2 ain2 int2 hi-z o o 42 ph3 ain3 hi-z o o 43 ph4 ain4 hi-z o o 44 ph5 ain5 hi-z o o 45 ph6 ain6 hi-z o o 46 ph7 ain7 hi-z o o 47 pi0 ain8 hi-z o o 48 pi1 ain9 hi-z o o
2 pin layout and pin functions tmpm380/m382 tmpm380/m382 - 12 / 13 - table 2-2 pin function (4/4) pin no. pin name output during reset schimitt (o:yes) open drain mode 49 avss 50 avdd5 51 dvss 52 dvdd5 53 pl0 boot pull up o 54 ftest3 hi-z(note) 55 pb0 traceclk hi-z o o 56 pb1 tracedata0 hi-z o o 57 pb2 tracedata1 hi-z o o 58 pb3 tms swdio pull up o o 59 pb4 tck swclk pull down o o 60 pb5 tdo swv hi-z o o 61 pb6 tdi pull up o o 62 pb7 trst pull up o o 63 pf0 tb7in hi-z o o 64 pf1 tb7out alarm hi-z o o (note) open : don?t connect any circuit. this pin use for internal test only.
tmpm380/m382 tmpm380/m382 - 13 / 13 - table 2-4 operating voltage of each pin pin name operating voltage function pm0,pm1 x1,x2 dvdd5 internal 1.5v x1 can?t be driven by outside oscillator. pp0,pp1 xt1,xt2 dvdd5 internal 1.5v xt1 can?t be driven by outside oscillator. reset mode must be connected to gnd pa to pg,pl,pn i/o dvdd5 ph,pi,pj ain0 to ain17 avdd5(vrefh) table 2-5 voltage range of each pin pin name voltage range function rvdd5 for internal circuit dvdd5 for i/o ports avdd5 4.0 5.5v for adc vout3 2.7 3.6v output terminal of internal power supply. connected to dvss through 1 to 4.7f capacito r dvss avss gnd note : vout3 can't supply the power supply to an external circuit.
tmpm380/m382 tmpm380/m382 - 1 / 2- 3 processor core 3.1 processor core the tx03 series has a high-performance 32-bit processor core (the arm cortex-m3 processor core). for information on the operations of this processor core, please refer to the ?cortex-m3 technical reference manual? issued by arm limited. this chapter describes the functions unique to the tx03 series that are no t explained in that document. the following table shows the revision of the proc essor core in the tmpm380/m382. for further information on each revision, see the documents issued by arm limited. product name core revision tmpm380 r2p0-00rel0 tmpm382 r2p0-00rel0 3.2 configurable opions the cortex-m3 core has the optional blocks. the optional blocks of the revision r2p0 are below; optional block implementation fpb o dwt o itm o mpu x etm tm o ahb-ap o ahb trace macro-cell interface o tpiu o wic x o: implement x: not implement 3.3 event tmpm380/m382 does not support event input/output. do not use sev instruction and wfe instruction. 3.4 sleepdeepl tmpm380/m382 does not support sleepdeep.
3 processor core tmpm380/m382 tmpm380/m382 - 2 / 2 - 3.5 exclusive access tmpm380/m382 does not supp ort exclusive access. 3.6 reset operation 3.6.1 initial state the internal circuits, register settings and pin status are undefined right after the power-on. the state continues until the reset pin receives low level input after all the power supply voltage is applied. 3.6.2 reset operation as the precondition, ensure that an internal high-frequenc y oscillator provides stable oscillation while power supply voltage is in the operating range. to reset the tmpm380/m382, input reset signal at low level for a minimu m duration of 12 system clocks (1.2 s with external 10mhz oscillator). 3.6.3 after reset when the reset is released, the system control register and the internal i/o register of the cortex-m3 processor core are initialized. note that the pll multiplication circuit stops after releasing the reset. therefore, set cgosccr regist er to use pll multiplication circuit once again. after the reset exception handling is executed, the program branches off to the interrupt service routine. the address with which the interrupt se rvice routine starts is stored in 0x0000_0004h (note 1) set the reset pin to "0" before turning the power on. release the reset after the power supply voltage has stabilized sufficiently within the operating range. (note 2) the reset operation may alter the internal ram state.
tmpm380/m382 tmpm380/m382 - 1 / 3 - 4 dubug interface 4.1 specification overview the tmpm380/m382 contains the serial wire jtag debug port (swj-dp) unit for interfacing with the in-circuit emulator (ice ) and the embedded trace macrocell tm (etm) unit for instruction trace output. trace data is output to the dedicated pins (tracedata[0]-[1], swv) via the on-chip trace port interface unit (tpiu). for details about swj-dp, etm and tpiu, refer to ?cortex-m3 technical reference manual?. 4.2 features of swj-dp swj-dp supports the two-pin serial wire de bug port (swdck, swdio) and the jtag debug port (tdi, tdo, tms, tck, trst). 4.3 features of etm etm supports two data signal pins (tracedata[0]-[1]), one clock signal pin (traceclk) and trace output from swv. 4.4 pin functions the debug interface pins can also be used as gen eral-purpose ports. the pb3 and pb4 are shared between the jtag debug port function and the serial wire debug port function. the pb5 is shared between the jtag debug port function and the swv trace output function. ? ()3,????? swj-dp etm ? function ? jtag debug function sw debug swj-dp pin name name of port i/o discription i/o discription tms/swdio pb3 input jtag test mode selection i/o serial wire data input/output tck/swclk pb4 input jtag test check input serial wire clock tdo/swv pb5 output jtag test data output (output) (note) (serial wire viewer output) tdi pb6 input jtag test data input trst --------------- pb7 input jtag test reset ------------------- traceclk pb0 output trace clock output tracedata0 pb1 output trace data output0 tracedata1 pb2 output trace data output1 (note) in case of enabling swv function. ? ? after reset, the pb3, pb4, pb5, pb6 and pb7 are configured as debug port function pins. the functions of other debug interface pins need to be programmed as required. debug interface pins can use general purpose port that is not use debug interface.
4 dubug interface tmpm380/m382 tmpm380/m382 - 2 / 3 - the table 4-2 below summarizes the debug interface pin functions and related port settings after reset. table 4-2 ? debug interface pins and port setting after reset port setting after reset initial setting port (bit name) debug function function (pbfr) input (pbie) output (pbcr) pull-up (pbpup) pull-down (pbpdn) port pb0 traceclk 0 0 0 0 0 port pb1 tarcedata0 0 0 0 0 0 port pb2 tracedata1 0 0 0 0 0 debug pb3 tms/swdio 1 1 1 1 0 debug pb4 tck/swclk 1 1 0 0 1 debug pb5 tdo/swv 1 0 1 0 0 debug pb6 tdi 1 1 0 1 0 debug pb7 trst --------------- 1 1 0 1 0 when using a low power consumption mode, take note of the following points. (note 1) if pb3 and pb5 are configured as debug function pins, output continues to be enabled even in stop mode regardless of t he setting of the cgstbycr . (note 2) if pb4 is configured as a debug functi on pin, it prevents a low power consumption mode from being fully effective. configure pb4 to function as a general-purpose port if the debug function is not used. 4.5 connection with a debug tool 4.5.1 how to connect for how to connect a debug tool, refer to t he method recommended by each manufacturer. debug interface pins have pull-up or pull-down re gister. when connect with pull-up or pull-down registers be sure their settings. 4.5.2 when use general purpose port when debugging, do not change setting debug interf ace to general purpose port by program. then, mcu will be unable to control signals received from the debugging tools and can not continue debugging. according to the usage of the debug interface pins, be sure their settings. ? table 4-3 debug interface using debug interface pins trst ------------------ tdi tdo/ swv tck/ swclk tms/ swdio trace data1 tarce data0 trace clk jtag+sw (after reset) jtag+sw (no trst ------------------ ) jtag+trace sw sw+swv disable debug function enable disable (can use general purpose port)
tmpm380/m382 tmpm380/m382 - 3 / 3 - 4.6 peripherals operation during halt mode ( one time stop of running program) when cortex-m3 cpu core going into halt mode by break operation during debbug mode,watch dog timer(wdt) count stops automatically. other peripherals c ontinue operation. (note) 16-bit timer (tmrb) and multi purpose ti mer (mpts) can be desable in halt mode. please refer to ?16-bit timer (tmrb)? and ?16-bit multi-purpose timers (mpts)?
tmpm380/m382 tmpm380/m382 - 1 / 4 - 5 memory map the memory maps for the tmpm380 are based on the arm cortex-m3 processor core memory map. the internal rom, internal ram and inter nal i/o of the tmpm380 are mapped to the code, sram and peripheral regions of the cortex-m3 resp ectively. the sram and internal i/o regions are all included in the bit-band region. the cpu register region is the processor core?s internal register region. for more information on each region, see the ?cortex-m3 technical reference manual?. note that access to regions indicated as ?fault? causes a memory fault if memory faults are enabled or a hard fault if memory faults are disabl ed. do not access the vendor-specific region. see ?special function registers? for details on the internal i/o region.
5 memory map tmpm380/m382 tmpm380/m382 - 2 / 4 - 5.1 tmpm380fy memory map fig 5-1 shows the memory map of the tmpm380fy. fig 5-1 mem o ry map single chip mode fault 0xffff ffff 0xe010 0000 0x41ff ffff 0x4000 0000 0xe00f ffff 0xe000 0000 internal io 0x0003 ffff 0x0000 0000 0x2000 3fff 0x2000 0000 vendor specific cpu register region fault internal ram (16k) fault ? internalrom (256k) ? internalrom (256k) internal io fault internalram (16k) fault bootrom (4k) ? 0x2000 3fff 0x2000 0000 0x41ff ffff 0x4000 0000 0x3f83 ffff 0x3f80 0000 0x0000 0fff 0x0000 0000 fault fault 0xffff ffff 0xe010 0000 0xe00f ffff 0xe000 0000 vendor specific cpu register region single boot mode
tmpm380/m382 tmpm380/m382 - 3 / 4 - 5.2 tmpm380fw/382fw memory map fig 5-2 shows the memory map of the tmpm380fw/382fw. fig 5-2 mem o ry map single chip mode fault 0xffff ffff 0xe010 0000 0x41ff ffff 0x4000 0000 0xe00f ffff 0xe000 0000 internal io 0x0001 ffff 0x0000 0000 0x2000 2fff 0x2000 0000 vendor specific cpu register region fault internal ram (12k) fault ? internalrom (128k) ? internalrom (128k) internal io fault internalram (12k) fault bootrom (4k) ? 0x2000 2fff 0x2000 0000 0x41ff ffff 0x4000 0000 0x3f81 ffff 0x3f80 0000 0x0000 0fff 0x0000 0000 fault fault 0xffff ffff 0xe010 0000 0xe00f ffff 0xe000 0000 vendor specific cpu register region single boot mode
5 memory map tmpm380/m382 tmpm380/m382 - 4 / 4 - 5.3 tmpm382fs memory map fig 5-3 shows the memory map of the tmpm382fs. fig 5-3 mem o ry map single chip mode fault 0xffff ffff 0xe010 0000 0x41ff ffff 0x4000 0000 0xe00f ffff 0xe000 0000 internal io 0x0000 ffff 0x0000 0000 0x2000 1fff 0x2000 0000 vendor specific cpu register region fault internal ram (8k) fault ? internalrom (64k) ? internalrom (64k) internal io fault internalram (8k) fault bootrom (4k) ? 0x2000 1fff 0x2000 0000 0x41ff ffff 0x4000 0000 0x3f80 ffff 0x3f80 0000 0x0000 0fff 0x0000 0000 fault fault 0xffff ffff 0xe010 0000 0xe00f ffff 0xe000 0000 vendor specific cpu register region single boot mode
tmpm380/m382 tmpm380/m382 - 1 / 24 6 clock/mode control 6.1 features the clock/mode control block enables to select clock gear, prescaler clock and warm-up of the pll (including clock multiplication circuit) and oscillator. the low power consumption mode can reduce power consumption.by mode transitions. this chapter describes how to control clocks, clock operating modes and mode transitions. the clock/mode control block ha s the following functions: y controls the oscillator y controls the system clock. y controls the prescaler clock. y controls the pll multiplication circuit. y controls the warm-up timer. in addition to normal mode, the tmpm380/m382 can operate in three types of low power mode to reduce power consumption according to its usage conditions.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 2 / 24 - 6.2 registers 6.2.1 register list table 6-1 shows registers and addresses of the clock generator. table 6-1 registers of clock generator register name address system control regist er cgsyscr 0x4004_0200 oscillation control register cgosccr 0x4004_0204 standby control register cgstbycr 0x4004_0208 pll selection register cgpllsel 0x4004_020c system clock selection re gister cgcksel 0x4004_0210
tmpm380/m382 tmpm380/m382 - 3 / 24 6.2.2 detailed description of registers 6.2.2.1 system control register (cgsyscr: 0x4004_0200 ) 7 6 5 4 3 2 1 0 bit symbol - - - - - gear2 gear1 gear0 read/write r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 high-speed clock (fc) gear function ?0? is read. 000: fc 001: reserved 010: reserved 011: reserved 100: fc/2 101: fc/4 110: fc/8 111: fc/16 15 14 13 12 11 10 9 8 bit symbol - - fpsel1 fpsel0 - prck2 prck1 prck0 read/write r r/w r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 prescaler clock function ?0? is read. fperiph clock 00:fgear 01:fc 1*: fs ?0? is read. 000: fperiph 001: fperiph/2 010: fperiph/4 011: fperiph/8 100: fperiph/16 101: fperiph/32 110: reserved 111: reserved 23 22 21 20 19 18 17 16 bit symbol - - - fcstop - - scosel1 scosel0 read/write r/w r r/w r r/w r/w after reset 0 0 0 0 0 0 0 1 function wtite ?0? ?0? is read. fclk for adc 0:enable 1:disable ?0? is read. scout clock 00:fs 01:fsys/2 10:fsys 11:  t0 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. : specifies the high-speed clock (fc) gear. : specifies th e prescaler clock to peripheral i/o. : specifie s the source clock to fperiph. : specifies the source clock to scout. : specifies the fclk to adc. : must be write ?0?.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 4 / 24 - 6.2.2.2 oscillation control register (cgosccr: 0x4004_0204) : enables to start the warm-up timer. ?0? is read. : enables to monito r the status of the warm-up timer. : specif ies operation of the pll. it stops after reset. setting the bit is required. note : when using the internal oscillator,please do not use pll. : select sour ce clock for warm-up timer bet ween high-speed oscillator and low-speed oscillator. high -speed oscillator is follo wed by . : specifies operation of the external high-speed oscillator1. : specifies operation of the external low-speed oscillator. : specifies operation of the internal high-speed oscillator2. : high speed osc illator switch from internal oscillator(osc1) to external oscillator(osc2).ofd does not use the f eature, after switching the external oscillator, it is recommended to stop the internal oscillator to reduce power consumption. also, after switching to an exte rnal oscillator, please not switch to the internal oscillator. 7 6 5 4 3 2 1 0 bit symbol - - - - wupsel1 pllon wuef wueon read/write r/w r/w r/w r/w r/w r/w r w after reset 0 0 1 1 0 0 0 0 function write ?0011? clock source for warm-up timer(wup) 0: high-speed oscillator (follow to wupsel2) 1: low-speed oscillator pll operation 0: stop 1: oscillation status of warm-up timer (wup) 0: warm-up completed 1: warm-up in operation operation of warm-up timer (wup) 0: don?t care 1: starting warm-up 15 14 13 12 11 10 9 8 bit symbol wuodr1 wuodr0 - - - - xten xen1 read/write r/w r/w r/w r r r/w r/w after reset 0 0 0 0 0 0 0 0 function bit1:0 for warm-up counter value. if high-speed oscillator is selected, is set ?0?. write ?0? ?0? is read. low-speed oscillator (external) 0: stop 1: oscillation high-speed oscillator 1 (external) 0: stop 1: oscillation 23 22 21 20 19 18 17 16 bit symbol wuodr5 wuodr4 wuodr3 wuodr2 wupsel2 hoscon oscsel xen2 read/write r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 1 function bit5:2 for warm-up counter value. clock source for warm-up timer(wup) 0: internal (osc2) 1: external (osc1) port m or x1/x2 0: port m 1: x1/x2 selection of high-speed oscillator 0: internal (osc2) 1: external (osc1) high-speed oscillator 2 (internal) 0: stop 1: oscillation 31 30 29 28 27 26 25 24 bit symbol wuodr13 wuodr12 wuodr11 wuodr10 wuodr9 wuodr8 wuodr7 wuodr6 read/write r/w after reset 0 0 0 0 0 0 0 0 function bit13:6 for warm-up counter value.
tmpm380/m382 tmpm380/m382 - 5 / 24 : specifies port m or x1/x2. when external oscillator is used, set pmcr/pmpup /pmpdn/pmie of port m to disable. after reset, pmcr/pmpup/pmpdn/pmie are set to disable. : select source clock for warm -up timer between internal oscillator(osc1) and external oscillator(osc2). when using stop/sleep mode, please select clock-surce that is same as to before entering to stop/sleep mode. : warm-up timer value. t if high-speed oscillator is selected, is set ?00?. : must be write ?0011?. : must be write ?00?.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 6 / 24 - 6.2.2.3 standby control register (cgstbycr: 0x4004_02 08) 7 6 5 4 3 2 1 0 bit symbol - - - - - stby2 stby1 stby0 read/write r r/w r/w r/w after reset 0 0 0 0 0 0 1 1 function ?0? is read. low power consumption mode 000: reserved 001: stop 010: sleep (note) 011: idle 1**: reserved 15 14 13 12 11 10 9 8 bit symbol - - - - - - rxten rxen read/write r r/w r/w after reset 0 0 0 0 0 0 0 1 function ?0? is read. low-speed oscillator after releasing stop mode 0: stop 1: oscillation high-speed oscillator after releasing stop mode 0: stop 1: oscillation 23 22 21 20 19 18 17 16 bit symbol - - - - - - - drve read/write r r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. write ?000?. port drive in stop mode 0: hi-z 1: drive 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. : specifies the low power consumption mode. note: before switch to slow mode, if the lo w-speed oscillator is disabled, enable the low-speed oscillator and then activate the warm-up by so ftware. and msut be selected ?fperiph? for peripferal i/o clock as fs by cgcyscr=1*. : specifies the high-speed osc illator operation after releasing the stop mode. must be written same data of cgosccr or which is selected to fc. : specifies the low-speed osc illator operation after releasing the stop mode. must be written same data of cgosccr. : specifies the pin status in the stop mode. : must be written ?000?.
tmpm380/m382 tmpm380/m382 - 7 / 24 6.2.2.4 pll selection register (cgpllsel: 0x4004_020c) : specifies use or disuse of the clock multiplied by the pll. ?fosc? is default value after reset. setting is required when using the pll. : must be write ?0001111? : must be write ?010? : must be write ?0111? 7 6 5 4 3 2 1 0 bit symbol - - - - - - - pllsel read/write r/w r/w after reset 0 0 0 1 1 1 1 0 function write ?0001111? select pll output 0: fosc 1: fpll 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r/w r r/w after reset 0 1 1 1 0 0 1 0 function write ?0111? ?0? is read. write ?010? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read 31 30 29 27 26 25 24 23 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read
6 clock/mode control tmpm380/m382 tmpm380/m382 - 8 / 24 - 6.2.2.5 system clock selection register (cgcksel: 0x4004_0210) < sysckflg > : shows the stat us of the system clock. swit ching the reading oscillator with generates time lag to complete . if the read value from is the same as the value specified in , the switching has been completed. : specifies system cl ock. when change value of this bit, oscillation must stable high-speed oscillator(1 or 2) and low-speed oscillator. according to the used oscillator, corr esponding cgosccr, or must be set to "1" in advance. 7 6 5 4 3 2 1 0 bit symbol - - - - - - sysck sysckflg read/write r r/w r after reset 0 0 0 0 0 0 0 0 function ?0? is read. system clock 0:high-speed (fc) 1: low-speed (fs) system clock status 0:high-speed (fc) 1: low-speed (fs) 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read.
tmpm380/m382 tmpm380/m382 - 9 / 24 6.3 clock control 6.3.1 clock system block diagram fig. 6-1 shows the clock system diagram. each clock is defined as follows. fosc1 : clock input from external high-speed oscillator (x1 and x2) fosc2 : clock input from internal high-speed oscillator fs : clock input from external low-speed oscillator (xt1 and xt2) fosc : high-speed clock specified by cgosccr fpll : clock quadrupled by pll fc : high-speed clock specified by cgpllsel fgear : high-speed clock spec ified by cgsyscr fsys : the same clock as fgear (system clock) fperiph : clock specified by cgsyscr t0 : prescaler clock spec ified by cgsyscr the high-speed clock fgear and the prescaler clock t0 are dividable. ? high-speed clock: fc, fc/2, fc/4, fc/8, fc/16 ? prescaler clock: fperiph, fperiph/2, f periph/4, fperiph/8, fperiph/16,fperiph/32 6.3.2 initial values after reset reset initializes the clock configuration as follows. high-speed oscillator2 (internal) : on (oscillating) high-speed oscillator1 (external) : off (stop) ? x1,x2 low-speed oscillator (external) : off (stop) ? xt1,xt2 pll (phase locked loop circuit) : off (stop) high-speed clock gear : fc (no frequency dividing) reset initializes all the clock configurations to be the same as fosc2. fc = fosc2 fsys = fc (=fosc2) fperiph = fc (=fosc2) t0 = fperiph (=fosc2) reset configures fsys to high-speed oscillator2 (internal)..
6 clock/mode control tmpm380/m382 tmpm380/m382 - 10 / 24 - fosc fpll fsys fs ? high-speed oscillator1 x1 x2 cgosccr cgosccr warm-up timer 1/2 1/4 1/8 1/16 fperiph (to peripheral i/o) pll cgsyscr cgsyscr cgosccr starts oscillation after reset scout fgear adc conversion clock adclk ? cgosccr pll stops after releasing reset cgpllsel cgcksel fs low-speed oscillator xt1 xt2 1/2 1/4 1/8 1/16 1/32 fperiph [peripheral i/o, prescaler input] tmrb, mpt, sio, sbi, ssp t0 cgsyscr fsys [ahb-bus i/o] cpu, rom, ram, boot rom, dmac [io-bus i/o] t mr b, mpt, w d t, rtc, sio, sbi, i2c, rmc, adc, port, fs cgosccr stops oscillation after reset. fc cgsyscr cgosccr [rtc] prescaler input [rmc] sampling clock 1/2 cgsyscr cgosccr stops oscillation after reset high-speed oscillator2 fosc1 fosc2 cgosccr ofd fcstop cgsyscr starts oscillation after reset fig. 6-1 clock block diagram (note1) (note2) the input clocks to selector shown with an arrow are set as default after reset. ofd can detect oscillation frequency of fosc1 only.
tmpm380/m382 tmpm380/m382 - 11 / 24 6.3.3 clock multiplication circuit (pll) this circuit outputs the fpll clock that is quadruple of the high-speed oscillator ou tput clock, fosc. this lowers the oscillator input frequency whil e increasing the internal clock speed. the pll is disabled after reset is released. to enable the pll, set "1" to the cgosccr bit. the pll requires a certain amount of time to be stabilized, which should be secured using the warm-up function. (note) it takes approx. 200 s for the pll to be stabilized 6.3.4 warm-up function the warm-up function secures the stability time for th e oscillator and the pll with the warm-up timer. the warm-up function is also used when returning fr om stop/sleep mode. in this case, an interrupt for returning from the low power consumption mode tri ggers the automatic timer count. after the specified time is reached, the system clock is output and the cpu starts operation. in stop/sleep modes, the pll is disabled. wh en returning from these modes, configure the warm-up time in consideration of the stability time of the pll and the oscillator. how to configure the warm-up function specify the count up clock for the warm-up timer in the cgosccr bits. the warm-up time can be specified by setting the cgosccr. the cgosccr are used to confirm the start and completion of warm-up timer through software (instruction). after the completion of warming- up timer is confirmed, switch the system clock by setting the cgcksel. when clock switching occurs, the current sy stem clock can be checked by monitoring the cgcksel. (note) the warm-up timer operates according to the oscillation clock, and it may contain errors if there is any fluctuation in th e oscillation frequency. therefore , the warm-up time should be taken as approximate time.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 12 / 24 - the following are the examples of the warm-up function configuration. cgosccr=?0? : specif y high speed oscillator. cgosccr=?1? : spec ify external oscillator. cgosccr=? warm-up time (1/fosc1)/4?/ : specify the warm-up time cgosccr0=?1? : start the warm-up timer (wup) cgosccr0 read : wait until the state becomes "0" (warm-up is finished) (note) when high-speed oscillator is selected by setting (=? 0 ?) for count-up clock of warming-up timer, lower 2-bits of is ?00?.
tmpm380/m382 tmpm380/m382 - 13 / 24 6.3.5 system clock the tmpm380 offers three selectable system clocks : two high-speed clocks and one low-speed clock. two kinds of high-speed clocks are selectable either internal oscillator or exter nal oscillator. after reset, internal oscillator is available, and external osc illator is stop. the high-speed clocks are dividable. 6.3.5.1 high speed clock ? input frequ ency from high-speed oscillator1 (x1 and x2) : 8mhz to 10mhz ? input frequency from high-speed osc illator2 (internal oscillator) : 10mhz ? clock gear:1/1, 1/2, 1/4, 1/8, 1/16 (after reset: 1/1) table 6-2 range of high-frequency (unit:mhz) clock gear (pll=on) clock gear (pll=off) input frequency min. operating freq. max. operating freq. after reset (pll=off, cg=1/1) 1/1 1/2 1/4 1/8 1/16 1/ 1 1/2 1/4 1/8 1/16 8mhz 8mhz 32 16 8 4 2 8 4 2 1 ** osc1 10mhz 10mhz 40 20 10 5 2.5 10 5 2.5 1.25 ** osc2 10mhz 1mhz 40mhz 10mhz 40 20 10 5 2.5 10 5 2.5 1.25 ** (note1) (note2) (note3) (note4) pll=on/off setting: availa ble in cgosccr clock gear setting: available in cgsyscr switching of clock gear is executed when a value is written to the cgsyscr register. the actual switching takes place after a slight delay. do not select 1/16 of clock gear when pll is set off. ** :reserved the following are the procedure of switching over fr om the internal oscillato r(osc2) to the external oscillator(osc1). (1) disables port m registers (pmcr/pmpup/pmpd n/pmie). after reset, these registers are disabled. (2) specifies proper wa rm-up time for the external oscillato r in to cgosccr[31:20]. (3) sets cgosccr to "1" to switch over from the port m to oscillator connection pins. (4) sets cgosccr to "1" to enable the external oscillator. (5) sets cgosccr to "1" to specify the external oscillator clock as source clock for warm-up counter. (6) sets cgosccr to "1" to start warm-up and waits till the end of warm-up (cgosccr becomes "0"). (7) sets cgosccr to "1" to switch the system clock to the external oscillator. (note ) with setting cgosccr to ?1?, rewriting the port m registers (pmdata/ pmcr/ pmod/ pmpup/ pmpdn/ pmie) are prohibited. with clearing cgosccr to ?0 ?, rewriting the cgosccr is prohibited.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 14 / 24 - 6.3.5.2 low speed clock ? input frequ ency from xt1 and xt2 table 6-3 range of low frequency input frequency range maximum operating frequency minimum operating frequency 30 to 34(khz) 34 khz 30 khz 6.3.6 prescaler clock control each peripheral function has a prescaler for dividing a clock. as the clock t0 to be input to each prescaler, the "fperiph" clock specified in t he cgsyscr can be divided according to the setting in the cgsyscr. after the co ntroller is reset, fperiph is selected as t0. (note) to use the clock gear, ensure that you make the time setting such that prescaler output tn from each peripheral function is slower than fsys ( tn < fsys). do not switch the clock gear while the timer counter or other peripheral function is operating. 6.3.7 system clock pin output function the tmpm380 enables to output the system clock fr om a pin. the pa1/scout pin can output the low speed clock fs, the system clock fsys and fsys/2 , and the prescaler input clock for peripheral i/o t0. by setting the port a registers, the pacr and pa fr2 to ?1?, the pa1/scout pin becomes the scout output pin. the output clock is selected by setting the cgsyscr. table 6-4 shows the pin states in each mode when the scout pin is set to the scout output. t able 6-4 scout output s tate in each mode low power consumption mode mode scout selection cgsyscr normal slow idle sleep stop = ?00? output the fs clock. = ?01? output t he fsys/2 clock. = ?10? output the fsys clock. = ?11? output the t0 clock. (note) the phase difference (ac timing) between the system clock output by the scout and the internal clock is not guaranteed. fixed to ?0? or ?1?.
tmpm380/m382 tmpm380/m382 - 15 / 24 6.4 modes and mode transitions 6.4.1 mode transitions the normal mode and the slow mode use the high- speed and low-speed clocks for system clock respectively. the idle, sleep and stop modes can be used as the low power consumption mode that enables to reduce power consumption by halting processor core operation. when the low-speed clock is not used, the slow and sleep modes cannot be used. fig. 6-2 shows a mode transition diagram for a de scri ption of sleep-on-exit, refer to ?cortex-m3 technical reference manual?. idle mode reset reset release instruction / slee p on exit stop mode slow mode sleep mode interru p t instruction / slee p on exit interru p t interru p t instruction / slee p on exit instruction / slee p on exit interru p t interru p t instruction / slee p on exit instruction normal mode (fosc) -6:*??-:? fig. 6-2 mode transition diagram
6 clock/mode control tmpm380/m382 tmpm380/m382 - 16 / 24 - 6.5 operation modes two operation modes, normal and slow, are avail able. the features of each mode are described below. 6.5.1 normal mode this mode is to operate the cpu core and the peripheral hardware by using the high-speed clock(fosc1 or fosc2). it is shifted to the normal mode with fosc2(internal high-speed oscillator) after reset. also low-speed clock is possible to use. 6.5.2 slow mode this mode is to operate the cpu core and the periph eral hardware by using the low-speed clock with high-speed clock stopped. the slow mode reduces power consumption compared to the normal mode. this mode allows only the following peripheral func tions to operate: i/o ports, real-time clock (rtc), tmrb, mpt(tmrb mode), remote co ntrol signal preprocessor (rmc). (note1) (note2) be sure to stop peripheral functions except for the cpu, rtc, i/o ports, tmrb, mpt(tmrb mode) and rmc before switching to the slow mode. in the slow mode, be sure not to perform reset using the application interrupt and reset control register of the cortex-m3 nvic register. 6.5.3 low power consumption mode the tmpm380 has three low power consumption modes: idle, sleep and stop. to switch to the low power consumption mode, specify the mode in the system control register cgstbycr and execute the wfi (wait for interrupt) in struction. in this case, execute reset or generate the interrupt to release the mode. releasing by the interrupt requires settings in advance. (note 1) (note 2) transition to the low power consumption mode by executing the wfe (wait for event) instruction is prohibited as the tmpm380 does not offer any event for releasing the low power consumption mode. the tmpm380 does not support the low power consumption mode configured with the sleepdeep bit in the cortex-m3 core. setting the sleepdeep bit of the system control register is prohibited. the features of each mode are described as follows.
tmpm380/m382 tmpm380/m382 - 17 / 24 6.5.4 idle mode only the cpu is stopped in this mode. each peripheral function has one bit in its control register for enabling or disabling operation in the idle mode. when the idle mode is entered, perip heral functions for whic h operation in the idle mode is disabled stop operation and hold the state at that time. the following peripheral functions can be enabled or disabled in the idle mode. for setting details, see the chapter on each peripheral function. y 16-bit timer/event counter (tmrb) y 16-bit multi purpose timer counter (mpt : except pmd function) y serial channel (sio) y serial bus interface (sbi) y ad converter (adc) y watchdog timer (wdt) y pll 6.5.5 sleep mode the internal low-speed oscillator, real time clock and rmc can op erate. by releasing the sleep mode, the device returns to the preceding mode of the sleep mode and starts operation. (note) when pb4 is configured as a debug function pin, it prevents the low power consumption mode from being fully effective. configure pb4 to function as a general-purpose port if the debug function is not used. 6.5.6 stop mode all the internal circuits including the in ternal oscillator are brought to a stop. by releasing the stop mode, the device return s to the preceding mode of the stop mode and starts operation. the stop mode enables to select the pin status by setting the cgstbycr. table 6-5 sho w s the pin status in the stop mode. (note) when pb4 is configured as a debug function pin, it prevents the low power consumption mode from being fully effective. configure pb4 to function as a general-purpose port when the debug function is not used.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 18 / 24 - table 6-5 pin states in stop mode pin name i/o =0 =1 control pins reset, mode input only x1,xt1 input only oscillator x2, xt2 output only ?h? level output ?h? level output input depends on pxie. ports pax to ppx output depends on pxcr. input depends on pxie debag interface tms/swdio/tdo/swv output external interrupts int0 to intf input depends on pxie. depends on pxie. ssp spnclk/spnfss/spndo output gemgn ______________ /mtnin input depends on pxie. mpt(igbt) mtnoutxx output emgn ___________ input depends on pxie. mpt(pmd) uon/von/won/xon/yon/zon output input depends on pxie. others output depends on pxcr. input or output enabled input or output disabled. oe signal (internal) of selected function is enabled and pxcr=1, then signal is output. n bit number 6.5.7 low power consumption mode setting the low power consumption mode is specified by the setting of the standby control register cgstbycr. table 6-6 shows the mode s etting in the . table 6-6 low power consumption mode setting mode cgstbycr stop 001 sleep 010 idle 011 (note) do not set any value other than those shown above in .
tmpm380/m382 tmpm380/m382 - 19 / 24 6.5.8 operational state in each mode table 6-7 sh ow the op erational state in each mode. for i/o port, ? ? and ?? indicate that input/output is enabled and disabled respectively. for other functions, ? ? and ?? indicate that clock is supplied and is not supplied respectively. table 6-7 operational state in each mode block normal slow idle sleep stop processor core i/o port * (note 3) ssp (note 1) adc (note 1) sio (note 1) (note 1) (note 1) sbi (note 1) (note 1) (note 1) wdt (note 1) (note 1) (note 1) tmrb (note 1) (note 1) mpt(tmrb mode) (note 1) (note 1) mpt(igbt mode) (note 1) on/off selectable for each module (note 1) (note 1) mpt(pmd mode) (note 1) (note 1) (note 1) rmc rtc cg pll ofd (note 4) (note 4) high-speed oscillator (fosc1) (note 2) high-speed oscillator (fosc2) (note 2) low-speed oscillator (fs) : operating, : stopped (note 1) in the slow mode, the adc, sio, sbi, ssp, mpt(igbt,pmd) and wdt cannot be used and must be stopped before switch to slow mode. (note 2) the high-speed oscillator(1 or 2) does not stop automatically in slow mode and must be stopped by setting cgosccr1 or after switched to slow mode. the high-speed oscillator(1 or 2) does not oscillate automatically in slow mode and must be enabled by setting cgosccr or before switch to normal mode. (note 3) the state depends on the cgstbycr. (note 4) when selecting fosc2 to system clock, ofd can?t be use.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 20 / 24 - 6.5.9 releasing the low power consumption mode the low power consumption mode can be released by an interrupt request, nmi or reset. the release source that can be used is determined by the low power consumption mode selected. details are shown in table 6-8 . t able 6-8 re lease source in each mode low power consumption mode idle sleep stop interrupt int0~f (note 1) intrtc intrmcrx intssp0,1 intsbi0,1 intrx0 to 4,/ inttx0 to 4 intadpd0,1/ intadcp0,1 intadtmr/ intadsft intpmd0,1/ intemg0,1 intmttb00 to 20 intmttb01 to 21 intmtcap00 to 20, 01,to 21 intmtemg0,1,2 inttb00 to 70,01 to 71 intcap00 to 70, 01 to 71 intenc0,1 intdmacerr/ intdmactc nmi (intwdt) nmi (intvltd) release source reset (reset pin and por) : starts the interrupt handling after the mode is released. (the reset initializes the lsi). : unavailable (note 1) to release the low power consumption mode by using the level mode interrupt, keep the level until the interrupt handling is started. changing the level before then will prevent the interrupt handling from starting properly. (note 2) for switching to the low power consumption mode, set the cpu to prohibit all the interrupts other than the release source. if not, releasing may be executed by an unspecified interrupt. release by interrupt request to release the low power consumption mode by an interrupt, the cpu must be set in advance to detect the interrupt. in addition to the setting in t he cpu, the clock generator must be set to detect the interrupt to be used to release the sleep and stop modes. release by nmi there are two kinds of nmi sources: wdt inte rrupt (intwdt) and vltd interrupt (intvltd). intwdt can be used in idle mode only.
tmpm380/m382 tmpm380/m382 - 21 / 24 release by reset any low power consumption modes can be released by reset from the reset pin. after that, the mode switches to normal and all the registers are initialized as is the case with normal reset. refer to section of ?interrupts" for details.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 22 / 24 - 6.5.10 warm-up mode transition requires the warm-up so that the oscillator provides stable oscillation. in the mode transition from stop to normal/ slow or from sleep to normal, the warm-up counter is activated automatically. and then the syst em clock output is started after the elapse of configured warm-up time. it is necessary to sele ct the oscillator to be used for warm-up in the cgosccr and to se t the warm-up time in t he cgosccr before executing the instruction to enter the stop/ sleep mode. (note) in stop/ sleep modes, the pll is disabled. when returning from these modes, configure the warm-up time in considerati on of the stability time of the pll and the ? oscillator. it takes approx. 200 s for the pll to be stabilized. in the transition from normal to slow/ sleep, t he warm-up is required so that the internal oscillator to stabilize if the low-speed oscillator is disabled. enable the low-speed oscillator and then activate the warm-up by software. in the transition from slow to normal when t he high-speed oscillator is disabled, enable the high-speed oscillator and then activate the warm-up. shows whether the warm-up setting of each mode transition is required or not. table 6-9 warm-up setting in mode transition mode transition warm-up setting normal idle not required normal sleep (note 1) normal slow (note 1) normal stop not required idle normal not required sleep normal auto-warm-up sleepslow not required slow normal (note 2) slow sleep not required slow stop not required stop normal auto-warm-up stop slow auto-warm-up (note 1) (note 2) if the low-speed oscillator is disabled, enable the low-speed oscillator and then activate the warm-up by software. if the high-speed oscillator is disable d, enable the high-speed oscillator and then activate the warm-up by software.
tmpm380/m382 tmpm380/m382 - 23 / 24 6.5.11 clock operations in mode transition the clock operations in mode transition are described in the following sections. 6.5.11.1 transition of operation modes: normal st op nor mal before entering to stop mode, please set warm ing-up time to cgosccr< wuodr[13:0]> and select clock-source that is same as to . when returning to normal mode from stop mode, warming-up timer is started automatically. 6.5.11.2 transition of operation modes: normal sleep no rmal before ente ring to sleep mode, please set wa rming-up time to cgosccr and select clock-source that is same as to . when returning to normal mode from sleep mode, warming-up timer is started automatically. normal normal stop mode warm-up completes. system clock starts. fsys (system clock) fosc warm-u p high-speed clock starts oscillating. warm-up starts. system clock stops. ? release event occurs. ? wfi instruction / sleep-on-exit ? normal normal sleep mode warm-up completes. system clock starts. ? fsys (system clock) fosc warm-u p high-speed clock starts oscillating. warm-up starts. ? system clock stops wfi instruction / slee p -on-exit release event occurs. ? fs (low-speed clock) oscillation continues.
6 clock/mode control tmpm380/m382 tmpm380/m382 - 24 / 24 - 6.5.11.3 transition of operation modes: slow stop slow the warm-up is activated automatica lly. it is necessary to set the wa rm-up time before entering the stop mode. 6.5.11.4 transition of operation modes: slow sleepslow the lo w-sp eed clock continues oscillation in the sleep mode. there is no need to make a warm-up setting. slow slow stop mode warm-up completes. system clock starts. ? fsys (system clock = fs) fs warm-u p low-speed clock starts oscillating. warm-up starts. ? system clock stops wfi instruction / sleep-on-exit ? release event occurs. ? slow slow sleep mode fsys (system clock = fs) fs system clock stops wfi instruction / slee p -on- exit release event occurs. ? system clock starts. ? ?
tmpm380/m382 tmpm380/m382 - 1 / 59 - 7 exceptions this chapter describes features, types and handling of exceptions. exceptions have close relation to the cpu core. re fer to ?cortex-m3 technical reference manual? if needed. 7.1 overview an exception causes the cpu to stop the current ly executing process a nd handle another process. there are two types of exceptions: those that are generated when so me error condition occurs or when an instruction to generate an exception is executed; and those that are generated by hardware, such as an interrupt request signal from an external pin or peripheral function. all exceptions are handled by the nested vectored inte rrupt controller (nvic) in the cpu according to the respective priority levels. when an exception oc curs, the cpu stores the cu rrent state to the stack and branches to the corresponding in terrupt service routine (isr). upon completion of the isr, the information stored to the stac k is automatically restored. 7.1.1 exception types the following types of exceptio ns exist in the cortex-m3. for detailed descriptions on each exception, refe r to ?cortex-m3 technical reference manual?. z reset z non-maskable interrupt (nmi) z hard fault z memory management z bus fault z usage fault z svcall (supervisor call) z debug monitor z pendsv z systick z external interrupt
7 exceptions tmpm380/m382 tmpm380/m382 - 2 / 59 - 7.1.2 handling flowchart the following shows how an exception/interrupt is handled. indicates hardware handling. indicates software handling. each step is described later in this chapter. processing description see detection by cg/cpu the cg/cpu detects the exception request. section 7.1.2.1 handling by cpu the cpu handles the exception request. branch to isr the cpu branches to the corresponding interrupt service routine (isr). section 7.1.2.2 execution of isr necessary processing is executed section 7.1.2.3 return from exception the cpu branches to another isr or returns to the previous program. section 7.1.2.4
tmpm380/m382 tmpm380/m382 - 3 / 59 - 7.1.2.1 exception request and detection (1) exception oc currence exception source s inclu de instruct ion execution by the cpu, memory accesses, and interrupt requests from external interrupt pins or peripheral functions. an exception by cpu instruction execution is caused when the cp u executes an instruction that generate an exception or when an error condi tion occurs during instruction execution. an exception also occurs by an instruction fetch from the execute never (xn) region or an access violation to the fault region. an interrupt is generated from an external interrupt pi n or peripheral function. for interrupts that are used for releasing a standby mode, relevant settings must be made in the clock generator. for details, refer to ?7.5 interrupts?. (2) exception detection if multiple exceptions occur simu lt a neo usly, the cpu takes the exception with the highest priority. table 7-1 shows the priority of exceptions. ?configurabl e? means that it is possible to assign a priority level to that exception. memory management, bus fault and usage fault exceptions can be enabled or disabled. if a disabled exception occurs, it is handled as hard fault.
7 exceptions tmpm380/m382 tmpm380/m382 - 4 / 59 - table 7-1 exception types and priority no exception type priority description reset -3 (highest) reset pin, wdt or sysretreq 2 non-maskable interrupt -2 wdt or vltd 3 hard fault -1 fault that cannot activate because a higher-priority fault is being handled or it is disabled 4 memory management configurable exception from the memory protection unit (mpu) (note 1) instruction fetch from the execute never (xn) region 5 bus fault configurable access violation to the hard fault region of the memory map 6 usage fault configurable undefined instruction execution or other faults related to instruction execution 7-10 reserved 11 svcall configurable system service call with svc instruction 12 debug monitor configurable debug monitor when the core is not halting 13 reserved 14 pendsv configurable pendable system service request 15 systick configurable notification from system timer 16- external interrupt configurable external interrupt pin or peripheral function (note 2) (note 1) this product does not contain the mpu (note 2) external interrupts have different sources and numbers in each product. for details, see ? 7.5.1.4 list of interrupt factors?. (3) priority setting use the interrupt priority registers to assign a priority to each of the ex ternal interrupts. the priority of other exceptions can be set in the system handler priority registers. the priority registers are configurabl e, allowing the number of bits for setting priority levels to vary between three to eight bits. therefore, the range of priority levels that can be assigned vary with each product. in case of eight bits, a priority level can be set from 0 to 255. priority level 0 is the highest priority level. in case of the same priority level to multiple exceptions, the lowest- numbered exception has the highest priority. (note) in this product, three bits are used for assigning a priority level in the interrupt priority registers and system handler priority registers.
tmpm380/m382 tmpm380/m382 - 5 / 59 - 7.1.2.2 exception handling and branch to the in terrupt service routin e (pre-em ption) when an exception occurs, the cpu suspends the currently executing proc ess and branches to the interrupt service routine. this is called ?pre-emption?. (1) stacking when the cpu detects an exception, it pushes the contents of the foll owing eight registers to the stack in the following order: ? program counter (pc) ? program status register (xpsr) ? r0 - r3 ? r12 ? link register (lr) the sp is decremented by eight words by the comp letion of the stack push. the following shows the state of the stack after the regi ster contents have been pushed. old sp sp (2) fetching an isr at the same time as p u shin g the register contents to the stack, the cpu executes an instruction to fetch an isr. prepare a vector table containing the top addresses of isrs for each exception. after reset, the vector table is located at address 0x0000_0000 in the code space. by setting the vector table offset register, it is possible to place the vector table at any address in the code or sram space. the vector table should also contain the initial value of the main stack. ? xpsr pc lr r12 r3 r2 r1 r0
7 exceptions tmpm380/m382 tmpm380/m382 - 6 / 59 - (3) late-arriving if the cpu detect s a hi gher priority exception before executing the isr for a pr evious exception, the cpu handles the higher priority exception first. this is called ?late-arriving?. a late-arriving exception causes the cpu to fetch a new vector address for branching to the corresponding isr, but the cpu does not newly push the register contents to the stack. (4) vector table the vecto r t able is configured as shown below. it must always be set the first four words (stack top address, reset isr address, nmi isr address, and hard fault isr address) . isr addresses for other exceptions are prepared in case if necessary. offset exception contents setting 0x00 reset initial value of the main stack required 0x04 reset isr address required 0x08 non-maskable interrupt isr address required 0x0c hard fault isr address required 0x10 memory management isr address optional 0x14 bus fault isr address optional 0x18 usage fault isr address optional 0x1c 0x28 reserved 0x2c svcall isr address optional 0x30 debug monitor isr address optional 0x34 reserved 0x38 pendsv isr address optional 0x3c systick isr address optional 0x40 external interrupt isr address optional
tmpm380/m382 tmpm380/m382 - 7 / 59 - 7.1.2.3 executing an isr an isr performs ne cessary processin g for the co rresponding exception. isrs must be prepared by the user. an isr may need to include code for clearing the interr upt request so that the same interrupt will not occur again upon return to normal program execution. for details about interrupt handling, see ? 7.5 interrupt ?. if a higher pri o rity exception occu rs during isr execution for the cu rrent exception, the cpu abandons the currently executing isr and services the newl y detected exception. 7.1.2.4 exception exit (1) execution af t er returning from an isr when retu rni ng from an isr, the cpu takes one of the following actions: z tail-chaining if a pending exception exists and there are no stac ked exceptions or the pending exception has higher priority than all stacked exceptions, the cp u returns to the isr of the pending exception. in this case, the cpu skips the pop of eight registers and push of eight registers when exiting one isr and entering another. this is called ?tail-chaining?. z returning to the last stacked isr if there are no pending exceptions or if the highest priority stacked exception is higher priority than the highest priority pending exception, the cpu returns to the last stacked isr. z returning to the previous program if there are no pending or stacked exceptions, the cpu returns to the previous program.
7 exceptions tmpm380/m382 tmpm380/m382 - 8 / 59 - (2) exception exit sequence when retu rning from an isr, the cp u performs the following operations: z pop eight registers pops the eight registers (pc, xpsr, r0 to r3 , r12 and lr) from the stack and adjust the sp. z load current active interrupt number loads the current active interrupt number from t he stacked xpsr. the cpu uses this to track which interrupt to return to. z select sp if returning to an exception (handler mode), sp is sp_main. if returning to thread mode, sp can be sp_main or sp_process.
tmpm380/m382 tmpm380/m382 - 9 / 59 - 7.2 reset exceptions reset exceptions are generated from the following three sources. use the reset flag (cgrstflg) register of the cl ock generator to identify the source of a reset. ? external reset pin a reset exception occurs when an external reset pin changes from ?l? to ?h?. ? reset exception by por a reset exception occurs when the power is turn ed on. for details, see the chapter on the por. ? reset exception by wdt the watchdog timer (wdt) has a reset generating f eature. for details, see the chapter on the wdt. ? reset exception by ofd the oscillation frequency detection (ofd) has a rese t generating feature. for details, see the chapter on the ofd. ? reset exception by sysresetreq a reset can be generated by setting the sysresetreq bit in the nvic?s application interrupt and reset control register. 7.3 non-maskable interrupts (nmis) non-maskable interrupts are generated from the following two sources. use the nmi flag (cgnmiflg) register of the clock generator to identify the source of a non-maskable interrupt. ? non-maskable interrupt by wdt the watchdog timer (wdt) has a non-maskable in terrupt generating feat ure. for details, see the chapter on the wdt. ? non-maskable interrupt by vltd the voltage level detector (vltd) has a non-mask able interrupt generating feature. for details, see the chapter on the vltd.
7 exceptions tmpm380/m382 tmpm380/m382 - 10 / 59 - 7.4 systick systick provides interr upt features using the cpu?s system timer. in case set a value in the systick reload value register and enable the systick features in the systick control and status register, the counter loads with the value set in the reload value register and begins counting down. when the counter reaches ?0?, a systick exception occurs. it is also possible to pend exceptions and use a flag to know when the timer reaches ?0?. the systick calibration value register holds a reload value for counting 10 ms with the system timer. the count clock frequency varies with each product, and so the value set in the systick calibration value register also varies with each product. (note) in this product, the system timer counts based on a clock obtained by dividing the clock input from the x1 pin by 32. the systick calibration value register is set to 0x9c4, which provides 10 ms timing when the clock input from x1 is 8 mhz. in case of 10mhz clock input, 10 ms timing is made by setting 0xc35 to systick reload register.
tmpm380/m382 tmpm380/m382 - 11 / 59 - 7.5 interrupt this chapter describes routes, factors and required settings of interrupts. the cpu is notified of interrupts by each signal of in terrupt factor. it sets priority on the interrupts and handles an interrupt request with the highest priority. the cpu is notified of the interrupt factor, which is used for clearing the standby modes, via a clock generator. therefore setting of the clock generator is required. 7.5.1 interrupt factors 7.5.1.1 interrupt route fig 7-1 shows an interrupt request route. fig 7-1 interrupt route peripheral ?  ? clock generator 
? interrupt request clearing standby mode ? ? external interrupt p in port peripheral ?  ?
7 exceptions tmpm380/m382 tmpm380/m382 - 12 / 59 - 7.5.1.2 interrupt signal generation an interrupt request signal is generated from an ex ternal pin assigned as the interrupt factor or a peripheral ip. ? from external pin set the port control register so that the external pin can perform as an interrupt function pin. ? from peripheral ip set the peripheral ip to make it possible to output the interrupt. see chapters of relevant ip for details. 7.5.1.3 transmission of interrupt signal an interrupt si gnal from an external pin or a peripheral ip is directly sent to t he cpu unless it is used to clear the standby mode. an interrupt that can be used to clear the stand by mode is transmitted to the cpu via the clock generator. therefore, it is necessary to set the clock generator in advanc e. an interrupt from an external pin can be used without setting the clock generator if it does not function as the clearing standby factor.
tmpm380/m382 tmpm380/m382 - 13 / 59 - 7.5.1.4 list of interrupt factors table 7-2 shows the list of interru pt factors. t able 7-2 list of hardware interrupt factors (1/2) int no. interrupt factors active level (clearing standby) cg interrupt mode control register 0 int0 interrupt pin (ph0/ain0/int0) 1 int1 interrupt pin (ph1/ain1/int1) 2 int2 interrupt pin (ph2/ain2/int2) 3 int3 interrupt pin (pa0/tb0in/int3) cgimcga 4 int4 interrupt pin (pa2/tb1in/int4) 5 int5 interrupt pin (pe4/tb2in//int5) high/low edge/level selectable cgimcgb 6 intrx0 serial reception (channel.0) 7 inttx0 serial transmit (channel.0) 8 intrx1 serial reception (channel.1) 9 inttx1 serial transmit (channel.1) 10 intssp0 syncronous serial port 0 11 intssp1 syncronous serial port 1 (note1) 12 intemg0 pmd0 emg interrupt (mpt0) 13 intemg1 pmd1 emg interrupt (mpt1) (note1) 14 intsbi0 serial bus interface 0 interrupt 15 intsbi1 serial bus interface 1 interrupt (note1) 16 intadpd0 adc conversion triggered by pmd0 is finished 17 intrtc realtime clock interrupt low edge cgimcge 18 intadpd1 adc conversion tri ggered by pmd1 is finished 19 intrmcrx remote controller reception interrupt high edge cgimcge 20 inttb00 16bit tmrb0 compare matc h detection 0/ over flow 21 inttb01 16bit tmrb0 compare match detection 1 22 inttb10 16bit tmrb1 compare matc h detection 0/ over flow 23 inttb11 16bit tmrb1 compare match detection 1 24 inttb40 16bit tmrb4 compare matc h detection 0/ over flow 25 inttb41 16bit tmrb4 compare match detection 1 26 inttb50 16bit tmrb5 compare match detection 0/ over flow 27 inttb51 16bit tmrb5 compare match detection 1 28 intpmd0 pmd0 pwm interrupt (mpt0) 29 intpmd1 pmd1 pwm interrupt (mpt1) (note1) 30 intcap00 16bit tmrb0 input capture 0 31 intcap01 16bit tmrb0 input capture 1 32 intcap10 16bit tmrb1 input capture 0 33 intcap11 16bit tmrb1 input capture 1 34 intcap40 16bit tmrb4 input capture 0 35 intcap41 16bit tmrb4 input capture 1 36 intcap50 16bit tmrb5 input capture 0 37 intcap51 16bit tmrb5 input capture 1 38 int6 interrupt pin (pe6/tb3in/int6) (note1) 39 int7 interrupt pin (pe7/tb3out/int7) (note1) high/low edge/level selectable cgimcgb 40 intrx2 serial reception (channel.2) (note1) 41 inttx2 serial transmi t (channel.2) (note1) 42 intadcp0 adc conversion moni toring function interrupt 0 43 intadcp1 adc conversion moni toring function interrupt 1 44 intrx4 serial reception (channel.4) (note1) 45 inttx4 serial transmi t (channel.4) (note1)
7 exceptions tmpm380/m382 tmpm380/m382 - 14 / 59 - table 7-2 list of hardware interrupt factors (2/2) no. interrupt factors active trigger (clearing standby) cg interrupt mode control register 46 inttb20 16bit tmrb2 compare matc h detection 0/ over flow 47 inttb21 16bit tmrb2 compare match detection 1 48 inttb30 16bit tmrb3 compare matc h detection 0/ over flow 49 inttb31 16bit tmrb3 compare match detection 1 50 intcap20 16bit tmrb2 input capture 0 51 intcap21 16bit tmrb2 input capture 1 52 intcap30 16bit tmrb3 input capture 0 53 intcap31 16bit tmrb3 input capture 1 54 intadsft adc conversion started by software is finished 55 reserved reserved 56 intadtmr adc conversion triggered by timer is finished 57 reserved reserved 58 int8 interrupt pin (pa7/tb4in/int8) 59 int9 interrupt pin (pd3/int9) (note1) 60 inta interrupt pin (pj6/ain6/inta) (note1) 61 intb interrupt pin (pj7/ain7/intb) (note1) high/low edge/level selectable cgimcgc 62 intenc0 encoder input0 interrupt (note1) 63 intenc1 encoder input1 interrupt (note1) 64 intrx3 serial reception (channel.3) (note1) 65 inttx3 serial transmit (channel.3) (note1) 66 inttb60 16bit tmrb6 compare match detection 0 / over flow 67 inttb61 16bit tmrb6 compare match detection 1 68 inttb70 16bit tmrb7 compare match detection 0 / over flow 69 inttb71 16bit tmrb7 compare match detection 1 70 intcap60 16bit tmrb6 input capture 0 71 intcap61 16bit tmrb6 input capture 1 72 intcap70 16bit tmrb7 input capture 0 73 intcap71 16bit tmrb7 input capture 1 74 intc interrupt pin (pd0/enca0/tb5in/intc) (note1) 75 intd interrupt pin (pd2/encz0/intd) (note1) 76 inte interrupt pin (pn7/mt2in/inte) (note1) 77 intf interrupt pin (pl2/intf) high/low edge/level selectable cgimcgd 78 intdmacerr dma transfer error 79 intdmactc dma end of transfer 80 intmttb00 16-bit mpt0 igbt period/ compare match detection 0/ over flow 81 intmttb01 16-bit mpt0 igbt trigger/ compare match detection 1 82 intmttb10 16-bit mpt1 igbt period/ compare match detection 0/ over flow (note1) 83 intmttb11 16-bit mpt1 igbt trigger/ compare match detection 1 (note1) 84 intmttb20 16-bit mpt2 igbt period/ compare match detection 0/ over flow (note1) 85 intmttb21 16-bit mpt2 igbt trigger/ compare match detection 1 (note1) 86 intmtcap00 16-bit mpt0 input capture 0 87 intmtcap01 16-bit mpt0 input capture 1 88 intmtcap10 16-bit mpt1 input capture 0 (note1) 89 intmtcap11 16-bit mpt1 input capture 1 (note1) 90 intmtcap20 16-bit mpt2 input capture 0 (note1) 91 intmtcap21 16-bit mpt2 input capture 1 (note1) 92 intmtemg0 16-bit mpt0 igbt emg interrupt 93 intmtemg1 16-bit mpt1 igbt emg interrupt (note1) 94 intmtemg2 16-bit mpt2 igbt emg interrupt (note1) note1 : for tmpm380
tmpm380/m382 tmpm380/m382 - 15 / 59 - 7.5.1.5 active level the active level indicate s which change in signal of an interrupt factor triggers an interrupt. the cpu recognize an interrupt signal as an interrupt factor w hen it is changed from ?l? to ?h?. a signal directly sent from the peripheral ip to the cpu is configur ed to output the ?h? pulse as an interrupt request. only interrupt request from external pin have the opt ion as the interrupt to clear the standby mode. the active level setting for clock generator is selectable from ?h? level, ?l? level, rising edge or falling edge. if the interrupt is used for clearing the standby mode, setting the clock generator register is required. i.e. enable the cgimcgx bit and specify the active level in the cgimcgx bits. the interrupt detected by the clock generator is notified to the cpu as ?h? level signal. an interrupt from the external pin can be used with out setting the clock generator in case it does not function as the standby clearing factor. however, inpu tting the ?h? pulse or the ?h? level signal is required so that the cpu can detect it as an interrupt factor.
7 exceptions tmpm380/m382 tmpm380/m382 - 16 / 59 - 7.5.2 interrupt handling 7.5.2.1 flowchart the follo wing sho ws how an interrupt is handled. indicates hardware handling. indicates software handling. processing details see settings for detection set the cpu register to detect an interrupt. set the clock generator as well if the interrupt clear the standby mode. common setting cpu register setting to clear standby mode clock generator 7.5.2.2 preparation settings for generating interrupt request signal execute an appropriate setting to generate the interrupt signal depending on the interrupt type. interrupt from the external pin port interrupt from peripheral ip peripheral ip (see chapters of relevant ip for details.) hardware interrupt factor is generated the hardware interrupt factor is generated. cg detects interrupt (factor to clear standby mode) the interrupt, which is used for clearing the standby modes, is connected to the cpu via the clock generator. 7.5.2.3 detection by cg clearing standby mode not clearing standby mode
tmpm380/m382 tmpm380/m382 - 17 / 59 - processing details see detecting interrupt the cpu detects the interrupt. in case several interrupt fact or are detected, the interrupt factor with the highest priority is selected according to the priority order. 7.5.2.4 dete ction by cpu handling interrupt the cpu handles the interrupt. the cpu pushes resister c ontents to the stack before entering the interrupt service routine 7.5.2.5 cpu pr oc essing executing interrupt service routine program for the interrupt service routine. clear the interrupt factor if needed. returning to preceding program configure to return to the preceding program from the interrupt service routine. 7.5.2.6 interrupt se rv ice routin e
7 exceptions tmpm380/m382 tmpm380/m382 - 18 / 59 - 7.5.2.2 preparation when pre paring for an interrupt, it is needed to pay att ention to the order of co nfiguration to avoid any unexpected interrupt on the way. initiating an interrupt or changing its configuration must be implemented in the following order basically. disable the interrupt by the cpu. configure from the farthest route from the cpu. then enable the interrupt by the cpu. in order not to generate unnecessary interrupt after condition setting, in case of setting the clock generator, it need to clear the interrupt related dat a in the clock generator before enable the interrupt. the following shows the order of interrupt handling and describe how to configure them. (1) disabling interrupt by cpu (2) cpu registers setting (3) preconfiguration 1 (inter rupt from external pin) (4) preconfiguration 2 (interrupt from peripheral ip) (5) configuring the clock generator (6) enabling interrupt by cpu (1) disabling interrupt by cpu t o make th e cpu for not accepting any interrupt, write ?1? to the corresponding bit of the interrupt clear-enable register. each bit of the register, of whic h default setting is ?0? with interrupt disabled, is assigned to single interrupt factor. cpu register interrupt clear-enable ?1?(disable interrupt) (note) m: corresponding bit. (2) cpu interrupt registers setting assign a i n te rrupt priority level from 0 to 255 by writ ing to the eight bit field in an interrupt priority register. priority level 0 is the highest priority level. cpu register interrupt priority ?priority? (note) m: corresponding bit.
tmpm380/m382 tmpm380/m382 - 19 / 59 - (3) preconfiguration 1 (interru pt from external pin) set ?1? to the port function register of the corre sponding pin. setting pnfrx[m] allows the pin to be used as the function pin. setting pnie[m] a llows the pin to be used as the input port. port register pnfrx ?1? pnie ?1? (note) n: port number m: corresponding bit x: function register number (4) preconfiguration 2 (interrupt from peripheral ip) the setting varie s de pending on the ip to be used. see chapters of relevant ip for details. (5) configuring the clock generator for an interrupt to clear the st and by mode, conf ig ure active level and enabling interrupt by the cgimcg register of the clock gener ator. the cgimcg registers are the registers for configuring each factor. before enabling an interrupt, clear the corresponding interrupt request already held. this can avoid unexpected interrupt. to clear corresponding interrupt r equest, write value corresponding to the interrupt to be used to the cgicrcg register. see 7.6.3.6 cg interrupt request clear register for each value. an interrupt from the extern al pin can be used with out setting the clock generator if it does not function as the standby clearing factor. however, inputting the ?h? pulse or the signal in ?h? level is required so that the cpu can detect it as an interrupt factor. clock generator register cgimcgn active level cgicrcg value corresponding to the interrupt to be used cgimcgn ?1? (interrupt enabled) (note) n: register number m: number assigned to each interrupt factor
7 exceptions tmpm380/m382 tmpm380/m382 - 20 / 59 - (6) enabling interrupt by cpu enable the inte rrupt by the cpu a s shown below. it is possible to clear the suspended interrupt by writing the interrupt clear -pending register. then, enable the intended interrupt with the interrupt set-enable register. each bit of the register is assigned to each interrupt factor. writing ?1? to the corresponding bit of the clear -pending register clears the suspended interrupt. writing ?1? to the corresponding bit of the set- enable register enables the intended interrupt. cpu register interrupt clear-pending ?1? interrupt set-enable ?1? (note) m: corresponding bit 7.5.2.3 detection by clock generator if the interrup t is used for clearing the standby mode, t he interrupt factor is detected by an active level specified in the clock generator, and notified to the cpu. the interrupt active level triggered by a rising or falling edge is kept in the clock generator after detection. however, if ?h? or ?l? level signal is specif ied as the trigger to enter the active state, the cpu considers that the interrupt factor is cleared upon exiting from the active state. therefore, the active state needs to be kept until the interrupt is detected. the clock generator notified to t he cpu the interrupt detected by ?h? level signal. the cpu considers the interrupt signal as an interrupt factor when it is changed from ?l? to ?h?. to generate an interrupt again, the factor held in the clock generator needs to be cleared with the cgicrcg clear register. 7.5.2.4 detection by cpu the cpu det ect s an interrupt factor with the highest priority. 7.5.2.5 cpu processing on detec ting the interrupt, the cpu pushes the cont ents of pc, psr, r0-r3, r12 and lr to the stack before entering the interrupt service routine.
tmpm380/m382 tmpm380/m382 - 21 / 59 - 7.5.2.6 interrupt service routine interrupt service ro utine requires specific progra mming according to the application to be used. this section describes what is reco mmended at the service routine programming and how the factor is cleared. (1) pushing during interrupt service routine common interru pt service routine is accompanied wi th the interrupt handling and the pushing of the register contents. the cortex-m3 core automatically pushes the contents of pc, psr, r0-r3, r12 and lr to the stack. no extra programming is required for them. push the contents of other registers if needed. an interrupt with the higher priority and faults such as nmi are accepted even when the interrupt service routine is being executed. therefore, it is recommend to push t he contents of the general purpose register that might be rewritten. (2) clearing interrupt factor as for an interrupt factor clea rin g the standby mo de, it need to clear the interrupt request with the cgicrcg register of the clock generator. if ?h? or ?l? level signal is specified as the trigger to enter the active state, the factor is held unless it is cleared. in this case, the factor needs to be cleared. clearing the factor causes clearing the interrupt request signal from clock generator. if a rising or falling edge is specified as the trigger to enter the active state, the factor is cleared by setting the value which corresponds to the interrupt, to the cgicrcg register. the factor is detected again when the specified edge appears again.
7 exceptions tmpm380/m382 tmpm380/m382 - 22 / 59 - 7.6 exception/interrupt-related registers the clock generator regi sters and their addresses are as shown below. 7.6.1 register list nvic resisters systick control and stat us resister 0xe000_e010 systick reload value resister 0xe000_e014 systick current value resister 0xe000_e018 systick calibration value register 0xe000_e01c interrupt set-enable register 1 0xe000_e100 interrupt set-enable register 2 0xe000_e104 interrupt set-enable register 3 0xe000_e108 interrupt clear-enable register 1 0xe000_e180 interrupt clear-enable register 2 0xe000_e184 interrupt clear-enable register 3 0xe000_e188 interrupt set-pending register 1 0xe000_e200 interrupt set-pending register 2 0xe000_e204 interrupt set-pending register 3 0xe000_e208 interrupt clear-pending register 1 0xe000_e280 interrupt clear-pending register 2 0xe000_e284 interrupt clear-pending register 3 0xe000_e288 interrupt priority register 0xe000_e400 - 0xe000_e45c vector table offset register 0xe000_ed08 system handler priority register 0xe000_ed18,0xe000_e d1c,0xe000_ed20 system handler control and state register 0xe000_ed24 clock generator registers cgicrcg cg interrupt request clear register 0x4004_0214 cgnmiflg nmi flag register 0x4004_0218 cgrstflg reset flag register 0x4004_021c cgimcga cg interrupt mode control register a 0x4004_0220 cgimcgb cg interrupt mode control register b 0x4004_0224 cgimcgc cg interrupt mode control register c 0x4004_0228 cgimcgd cg interrupt mode control register d 0x4004_022c cgimcge cg interrupt mode control register e 0x4004_0230
tmpm380/m382 tmpm380/m382 - 23 / 59 - 7.6.2 nvic registers 7.6.2.1 systick control and status register 7 6 5 4 3 2 1 0 bit symbol clk source tickint enable read/write r r/w r/w r/w after reset 0 0 0 0 function ?0? is read. 0: external reference clock 1: core clock 0: do not pend systick 1: pend systick 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol count flag read/write r r/w after reset 0 0 function ?0? is read. 0: timer not counted to 0 1: timer counted to 0 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function ?0? is read. 1 = the counter loads with the reload value and then begins counting down. 0 = the timer is disabled. 1 = systick exceptions are pended. 0 = systick exceptions are not pended. 0 = external reference clock 1 = core clock 1 =indicates t hat the timer counted to 0 since last time this was read. clears on read of any part of the sy stick control and status register.
7 exceptions tmpm380/m382 tmpm380/m382 - 24 / 59 - 7.6.2.2 systick reload value register 7 6 5 4 3 2 1 0 bit symbol reload read/write r/w after reset undefined function reload value 15 14 13 12 11 10 9 8 bit symbol reload read/write r/w after reset undefined function reload value 23 22 21 20 19 18 17 16 bit symbol reload read/write r/w after reset undefined function reload value 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function ?0? is read. set the value to load into the sy stick current value register when the timer reaches ?0?. (note) in this product, the system timer counts based on a clock obtained by dividing the clock input from the x1 pin by 32.
tmpm380/m382 tmpm380/m382 - 25 / 59 - 7.6.2.3 systick current value register 7 6 5 4 3 2 1 0 bit symbol current read/write r/w after reset undefined function [read] current systick timer value [write] clear 15 14 13 12 11 10 9 8 bit symbol current read/write r/w after reset undefined function [read] current systick timer value [write] clear 23 22 21 20 19 18 17 16 bit symbol current read/write r/w after reset undefined function [read] current systick timer value [write] clear 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function ?0? is read. [read] current systick timer value. [write] writing to this register with any va lue clears it to 0. clearing this register also clears the countflag bit of the systick control and status register.
7 exceptions tmpm380/m382 tmpm380/m382 - 26 / 59 - 7.6.2.4 systick calibration value register 7 6 5 4 3 2 1 0 bit symbol tenms read/write r after reset 1 1 0 0 0 1 0 0 function calibration value (note) 15 14 13 12 11 10 9 8 bit symbol tenms read/write r after reset 0 0 0 0 1 0 0 1 function calibration value (note) 23 22 21 20 19 18 17 16 bit symbol tenms read/write r after reset 0 0 0 0 0 0 0 0 function calibration value (note) 31 30 29 28 27 26 25 24 bit symbol noref skew read/write r r r after reset 0 0 0 function 0: reference clock provided 1: no reference clock 0: calibration value is 10 ms. 1: calibration value is not 10 ms. ?0? is read. reload value to use for 10 ms timing (0x9c4). (note) 1 = the calibration value is not exactly 10 ms. 1 = the reference clock is not provided. (note) in this product, the system timer counts based on a clock obtained by dividing the clock input from the x1 pin by 32. the systick calibration value register is set to a value that provides 10 ms timing when the cock input from x1 is 8 mhz. in case of 10mhz clock input, 10 ms timing is made by setting 0xc35 to systick reload register.
tmpm380/m382 tmpm380/m382 - 27 / 59 - 7.6.2.5 interrupt set-enable register 1 7 6 5 4 3 2 1 0 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 7 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 6 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 5 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 4 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 3 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 2 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 1 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 0 [write] 1: enable [read] 0: disabled 1: enabled 15 14 13 12 11 10 9 8 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 15 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 14 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 13 [write] 1: enable [read] 0 disabled 1: enabled interrupt number 12 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 11 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 10 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 9 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 8 [write] 1: enable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 23 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 22 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 21 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 20 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 19 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 18 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 17 [write] 1: enable [read] 0: disabled 1: enabled interrupt number16 [write] 1: enable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 31 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 30 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 29 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 28 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 27 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 26 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 25 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 24 [write] 1: enable [read] 0: disabled 1: enabled use these bits to enable interrupts or det ermine which interrupts are currently enabled. writing ?1? to a bit in this register enables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns t he current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
7 exceptions tmpm380/m382 tmpm380/m382 - 28 / 59 - ? 7.6.2.6 interrupt set-enable register 2 7 6 5 4 3 2 1 0 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 39 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 38 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 37 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 36 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 35 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 34 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 33 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 32 [write] 1: enable [read] 0: disabled 1: enabled 15 14 13 12 11 10 9 8 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 47 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 46 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 45 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 44 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 43 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 42 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 41 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 40 [write] 1: enable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 55 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 54 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 53 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 52 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 51 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 50 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 49 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 48 [write] 1: enable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 63 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 62 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 61 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 60 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 59 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 58 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 57 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 56 [write] 1: enable [read] 0: disabled 1: enabled use these bits to enable interrupts or det ermine which interrupts are currently enabled. writing ?1? to a bit in this register enables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns t he current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors .
tmpm380/m382 tmpm380/m382 - 29 / 59 - 7.6.2.7 interrupt set-enable register 3 ? 7 6 5 4 3 2 1 0 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 71 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 70 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 69 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 68 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 67 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 66 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 65 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 64 [write] 1: enable [read] 0: disabled 1: enabled 15 14 13 12 11 10 9 8 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 79 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 78 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 77 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 76 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 75 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 74 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 73 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 72 [write] 1: enable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol setena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 87 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 86 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 85 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 84 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 83 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 82 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 81 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 80 [write] 1: enable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol setena read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. interrupt number 94 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 93 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 92 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 91 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 90 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 89 [write] 1: enable [read] 0: disabled 1: enabled interrupt number 88 [write] 1: enable [read] 0: disabled 1: enabled use these bits to enable interrupts or det ermine which interrupts are currently enabled. writing ?1? to a bit in this register enables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns t he current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors .
7 exceptions tmpm380/m382 tmpm380/m382 - 30 / 59 - 7.6.2.8 interrupt clear-enable register 1 ? 7 6 5 4 3 2 1 0 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 7 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 6 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 5 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 4 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 3 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 2 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 1 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 0 [write] 1: disable [read] 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 15 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 14 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 13 [write] 1: disable [read] 0: disabled 1 enabled interrupt number 12 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 11 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 10 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 9 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 8 [write] 1: disable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 23 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 22 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 21 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 20 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 19 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 18 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 17 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 16 [write] 1: disable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 31 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 30 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 29 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 28 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 27 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 26 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 25 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 24 [write] 1: disable [read] 0: disabled 1: enabled use these bits to disable or determine wh ich interrupts are currently disabled. writing ?1? to a bit in this register disables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns t he current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors . ?
tmpm380/m382 tmpm380/m382 - 31 / 59 - 7.6.2.9 interrupt clear-enable register 2 ? 7 6 5 4 3 2 1 0 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 39 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 38 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 37 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 36 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 35 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 34 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 33 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 32 [write] 1: disable [read] 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 47 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 46 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 45 [write] 1: disable [read] 0: disabled 1 enabled interrupt number 44 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 43 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 42 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 41 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 40 [write] 1: disable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 55 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 54 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 53 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 52 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 51 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 50 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 49 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 48 [write] 1: disable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 63 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 62 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 61 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 60 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 59 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 58 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 57 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 56 [write] 1: disable [read] 0: disabled 1: enabled use these bits to disable or determine wh ich interrupts are currently disabled. writing ?1? to a bit in this register disables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns t he current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors . .
7 exceptions tmpm380/m382 tmpm380/m382 - 32 / 59 - 7.6.2.10 interrupt clear-enable register 3 ? 7 6 5 4 3 2 1 0 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 71 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 70 [write] 1: disable [read] 0: disabled 1: enabled interrupt n umber 69 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 68 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 67 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 66 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 65 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 64 [write] 1: disable [read] 0: disabled 1: enabled 15 14 13 12 11 10 9 8 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt n umber 79 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 78 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 77 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 76 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 75 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 74 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 73 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 72 [write] 1: disable [read] 0: disabled 1: enabled 23 22 21 20 19 18 17 16 bit symbol clrena read/write r/w after reset 0 0 0 0 0 0 0 0 function interrupt number 87 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 86 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 85 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 84 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 83 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 82 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 81 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 80 [write] 1: disable [read] 0: disabled 1: enabled 31 30 29 28 27 26 25 24 bit symbol clrena read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. interrupt number 94 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 93 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 92 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 91 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 90 [write] 1: disable [read] 0: disabled 1: enabled interrupt n umber 89 [write] 1: disable [read] 0: disabled 1: enabled interrupt number 88 [write] 1: disable [read] 0: disabled 1: enabled use these bits to disable or determine wh ich interrupts are currently disabled. writing ?1? to a bit in this register di sables the corresponding interrupt. writing ?0? has no effect. reading a bit in this register returns the current state of the corresponding interrupt as shown below. 0 = disabled 1 = enabled (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors .
tmpm380/m382 tmpm380/m382 - 33 / 59 - 7.6.2.11 interrupt set-pending register 1 ? 7 6 5 4 3 2 1 0 bit symbol setpend read/write r/w after reset undefined function interrupt number 7 [write] 1: pend [read] 0: not pending 1: pending interrupt number 6 [write] 1: pend [read] 0: not pending 1: pending interrupt number 5 [write] 1: pend [read] 0: not pending 1: pending interrupt number 4 [write] 1: pend [read] 0: not pending 1: pending interrupt number 3 [write] 1: pend [read] 0: not pending 1: pending interrupt number 2 [write] 1: pend [read] 0: not pending 1: pending interrupt number 1 [write] 1: pend [read] 0: not pending 1: pending interrupt number 0 [write] 1: pend [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol setpend read/write r/w after reset undefined function interrupt number 15 [write] 1: pend [read] 0: not pending 1: pending interrupt number 14 [write] 1: pend [read] 0: not pending 1: pending interrupt number 13 [write] 1: pend [read] 0: not pending 1: pending interrupt number 12 [write] 1: pend [read] 0: not pending 1: pending interrupt number 11 [write] 1: pend [read] 0: not pending 1: pending interrupt number10 [write] 1: pend [read] 0: not pending 1: pending interrupt number 9 [write] 1: pend [read] 0: not pending 1: pending interrupt number 8 [write] 1: pend [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol setpend read/write r/w after reset undefined function interrupt number 23 [write] 1: pend [read] 0: not pending 1: pending interrupt number 22 [write] 1: pend [read] 0: not pending 1: pending interrupt number 21 [write] 1: pend [read] 0: not pending 1: pending interrupt number 20 [write] 1: pend [read] 0: not pending 1: pending interrupt number 19 [write] 1: pend [read] 0: not pending 1: pending interrupt number 18 [write] 1: pend [read] 0: not pending 1: pending interrupt number 17 [write] 1: pend [read] 0: not pending 1: pending interrupt number 16 [write] 1: pend [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol setpend read/write r/w after reset undefined function interrupt number 31 [write] 1: pend [read] 0: not pending 1: pending interrupt number 30 [write] 1: pend [read] 0: not pending 1: pending interrupt number 29 [write] 1: pend [read] 0: not pending 1: pending interrupt number 28 [write] 1: pend [read] 0: not pending 1: pending interrupt number 27 [write] 1: pend [read] 0: not pending 1: pending interrupt number 26 [write] 1: pend [read] 0: not pending 1: pending interrupt number 25 [write] 1: pend [read] 0: not pending 1: pending interrupt number 24 [write] 1: pend [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 34 / 59 - use these bits to force interrupts into the pending state or determine which interrupts are currently pending. writing ?1? to a bit in this register pends the corresponding interrupt. however, writing ?1? has no effect on an interrupt that is already pending or is disabled. writing ?0? has no effect. reading a bit in this register returns the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending each bit in this register can be cleared by writing ?1? to the corresponding bit in the interrupt clear-pending register. (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
tmpm380/m382 tmpm380/m382 - 35 / 59 - 7.6.2.12 interrupt set-pending register 2 7 6 5 4 3 2 1 0 bit symbol setpend read/write r/w after reset undefined function interrupt number 39 [write] 1: pend [read] 0: not pending 1: pending interrupt number 38 [write] 1: pend [read] 0: not pending 1: pending interrupt number 37 [write] 1: pend [read] 0: not pending 1: pending interrupt number 36 [write] 1: pend [read] 0: not pending 1: pending interrupt number 35 [write] 1: pend [read] 0: not pending 1: pending interrupt number 34 [write] 1: pend [read] 0: not pending 1: pending interrupt number 33 [write] 1: pend [read] 0: not pending 1: pending interrupt number 32 [write] 1: pend [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol setpend read/write r/w after reset undefined function interrupt number 47 [write] 1: pend [read] 0: not pending 1: pending interrupt number 46 [write] 1: pend [read] 0: not pending 1: pending interrupt number 45 [write] 1: pend [read] 0: not pending 1: pending interrupt number 44 [write] 1: pend [read] 0: not pending 1: pending interrupt number 43 [write] 1: pend [read] 0: not pending 1: pending interrupt number42 [write] 1: pend [read] 0: not pending 1: pending interrupt number 41 [write] 1: pend [read] 0: not pending 1: pending interrupt number40 [write] 1: pend [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol setpend read/write r/w after reset undefined function interrupt number 55 [write] 1: pend [read] 0: not pending 1: pending interrupt number 54 [write] 1: pend [read] 0: not pending 1: pending interrupt number 53 [write] 1: pend [read] 0: not pending 1: pending interrupt number 52 [write] 1: pend [read] 0: not pending 1: pending interrupt number 51 [write] 1: pend [read] 0: not pending 1: pending interrupt number 50 [write] 1: pend [read] 0: not pending 1: pending interrupt number 49 [write] 1: pend [read] 0: not pending 1: pending interrupt number 48 [write] 1: pend [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol setpend read/write r/w after reset undefined function interrupt number 63 [write] 1: pend [read] 0: not pending 1: pending interrupt number 62 [write] 1: pend [read] 0: not pending 1: pending interrupt number 61 [write] 1: pend [read] 0: not pending 1: pending interrupt number 60 [write] 1: pend [read] 0: not pending 1: pending interrupt number 59 [write] 1: pend [read] 0: not pending 1: pending interrupt number 58 [write] 1: pend [read] 0: not pending 1: pending interrupt number 57 [write] 1: pend [read] 0: not pending 1: pending interrupt number 56 [write] 1: pend [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 36 / 59 - use these bits to force interrupts into the pending state or determine which interrupts are currently pending. writing ?1? to a bit in this register pends the corresponding interrupt. however, writing ?1? has no effect on an interrupt that is already pending or is disabled. writing ?0? has no effect. reading a bit in this register returns the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending each bit in this register can be cleared by writing ?1? to the corresponding bit in the interrupt clear-pending register. (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interru pt factors .
tmpm380/m382 tmpm380/m382 - 37 / 59 - 7.6.2.13 interrupt set-pending register 3 7 6 5 4 3 2 1 0 bit symbol setpend read/write r/w after reset undefined function interrupt number 71 [write] 1: pend [read] 0: not pending 1: pending interrupt number 70 [write] 1: pend [read] 0: not pending 1: pending interrupt number 69 [write] 1: pend [read] 0: not pending 1: pending interrupt number 68 [write] 1: pend [read] 0: not pending 1: pending interrupt number 67 [write] 1: pend [read] 0: not pending 1: pending interrupt number 66 [write] 1: pend [read] 0: not pending 1: pending interrupt number 65 [write] 1: pend [read] 0: not pending 1: pending interrupt number 64 [write] 1: pend [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol setpend read/write r/w after reset undefined function interrupt number 79 [write] 1: pend [read] 0: not pending 1: pending interrupt number 78 [write] 1: pend [read] 0: not pending 1: pending interrupt number 77 [write] 1: pend [read] 0: not pending 1: pending interrupt number 76 [write] 1: pend [read] 0: not pending 1: pending interrupt number 75 [write] 1: pend [read] 0: not pending 1: pending interrupt number 74 [write] 1: pend [read] 0: not pending 1: pending interrupt number 73 [write] 1: pend [read] 0: not pending 1: pending interrupt number 72 [write] 1: pend [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol setpend read/write r/w after reset undefined function interrupt number 87 [write] 1: pend [read] 0: not pending 1: pending interrupt number 86 [write] 1: pend [read] 0: not pending 1: pending interrupt number 85 [write] 1: pend [read] 0: not pending 1: pending interrupt number 84 [write] 1: pend [read] 0: not pending 1: pending interrupt number 83 [write] 1: pend [read] 0: not pending 1: pending interrupt number 82 [write] 1: pend [read] 0: not pending 1: pending interrupt number 81 [write] 1: pend [read] 0: not pending 1: pending interrupt number 80 [write] 1: pend [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol setpend read/write r r/w after reset 0 undefined function ?0? is read. interrupt number 94 [write] 1: pend [read] 0: not pending 1: pending interrupt number 93 [write] 1: pend [read] 0: not pending 1: pending interrupt number 92 [write] 1: pend [read] 0: not pending 1: pending interrupt number 91 [write] 1: pend [read] 0: not pending 1: pending interrupt number 90 [write] 1: pend [read] 0: not pending 1: pending interrupt number 89 [write] 1: pend [read] 0: not pending 1: pending interrupt number 88 [write] 1: pend [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 38 / 59 - use these bits to force interrupts in to the pending state or determine which interrupts are currently pending. writing ?1? to a bit in this register pends the corresponding interrupt. however, writing ?1? has no effect on an interrupt that is already pending or is disabled. writing ?0? has no effect. reading a bit in this register return s the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending each bit in this register can be cleared by writing ?1? to the corresponding bit in the interrupt clear-pending register. (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
tmpm380/m382 tmpm380/m382 - 39 / 59 - 7.6.2.14 interrupt clear-pending register 1 7 6 5 4 3 2 1 0 bit symbol clrpend read/write r/w after reset undefined function interrupt number 7 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 6 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 5 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 4 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 3 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 2 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 1 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 0 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol clrpend read/write r/w after reset undefined function interrupt number 15 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 14 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 13 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 12 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 11 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 10 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 9 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 8 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol clrpend read/write r/w after reset undefined function interrupt number 23 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 22 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 21 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 20 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 19 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 18 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 17 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 16 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol clrpend read/write r/w after reset undefined function interrupt number 31 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 30 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 29 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 28 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 27 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 26 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 25 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 24 [write] 1: clear pending interrupt [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 40 / 59 - use these bits to clear pending interr upts or determine which interrupts are currently pending. writing ?1? to a bit in this register clears the corresponding pending interrupt. however, writing ?1? has no effect on an interrupt that is already being serviced. writing ?0? has no effect. reading a bit in this register returns the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
tmpm380/m382 tmpm380/m382 - 41 / 59 - 7.6.2.15 interrupt clear-pending register 2 7 6 5 4 3 2 1 0 bit symbol clrpend read/write r/w after reset undefined function interrupt number39 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 38 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 37 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 36 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 35 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 34 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 33 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 32 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol clrpend read/write r/w after reset undefined function interrupt number 47 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 46 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 45 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 44 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 43 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 42 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 41 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 40 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol clrpend read/write r/w after reset undefined function interrupt number 55 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 54 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 53 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 52 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 51 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 50 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 49 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 48 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol clrpend read/write r/w after reset undefined function interrupt number 63 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 62 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 61 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 60 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 59 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number58 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 57 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 56 [write] 1: clear pending interrupt [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 42 / 59 - use these bits to clear pending interr upts or determine which interrupts are currently pending. writing ?1? to a bit in this register clears the corresponding pending interrupt. however, writing ?1? has no effect on an interrupt that is already being serviced. writing ?0? has no effect. reading a bit in this register returns the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
tmpm380/m382 tmpm380/m382 - 43 / 59 - 7.6.2.16 interrupt clear-pending register 3 7 6 5 4 3 2 1 0 bit symbol clrpend read/write r/w after reset undefined function interrupt number 71 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 70 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 69 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 68 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 67 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 66 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 65 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 64 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 15 14 13 12 11 10 9 8 bit symbol clrpend read/write r/w after reset undefined function interrupt number 79 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 78 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 77 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 76 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 75 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 74 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 73 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 72 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 23 22 21 20 19 18 17 16 bit symbol clrpend read/write r/w after reset undefined function interrupt number 87 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 86 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 85 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 84 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 83 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 82 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 81 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 80 [write] 1: clear pending interrupt [read] 0: not pending 1: pending 31 30 29 28 27 26 25 24 bit symbol clrpend read/write r r/w after reset 0 undefined function ?0? is read. interrupt number 94 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 93 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 92 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 91 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 90 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 89 [write] 1: clear pending interrupt [read] 0: not pending 1: pending interrupt number 88 [write] 1: clear pending interrupt [read] 0: not pending 1: pending
7 exceptions tmpm380/m382 tmpm380/m382 - 44 / 59 - use these bits to clear pending inte rrupts or determine which interrupts are currently pending. writing ?1? to a bit in this register clears the corresponding pending interrupt. however, writing ?1? has no effect on an interrupt that is already being serviced. writing ?0? has no effect. reading a bit in this register return s the current state of the corresponding interrupt as shown below. 0 = not pending 1 = pending (note) for descriptions of interrupts and interrupt numbers, see section 7.5.1.4 list of interrupt factors .
tmpm380/m382 tmpm380/m382 - 45 / 59 - 7.6.2.17 interrupt priority registers each inte rrupt is provide d with eight bi ts of an interrupt priority register. the following shows the addresses of the interr upt priority registers corresponding to interrupt numbers. 31 24 23 16 15 8 7 0 0xe000_e400 pri_3 pri_2 pri_1 pri_0 0xe000_e404 pri_7 pri_6 pri_5 pri_4 0xe000_e408 pri_11 pri_10 pri_9 pri_8 0xe000_e40c pri_15 pri_14 pri_13 pri_12 0xe000_e410 pri_19 pri_18 pri_17 pri_16 0xe000_e414 pri_23 pri_22 pri_21 pri_20 0xe000_e418 pri_27 pri_26 pri_25 pri_24 0xe000_e41c pri_31 pri_30 pri_29 pri_28 0xe000_e420 pri_35 pri_34 pri_33 pri_32 0xe000_e424 pri_39 pri_38 pri_37 pri_36 0xe000_e428 pri_43 pri_42 pri_41 pri_40 0xe000_e42c pri_47 pri_46 pri_45 pri_44 0xe000_e430 pri_51 pri_50 pri_49 pri_48 0xe000_e434 pri_55 pri_54 pri_53 pri_52 0xe000_e438 pri_59 pri_58 pri_57 pri_56 0xe000_e43c pri_63 pri_62 pri_61 pri_60 0xe000_e440 pri_67 pri_66 pri_65 pri_64 0xe000_e444 pri_71 pri_70 pri_69 pri_68 0xe000_e448 pri_75 pri_74 pri_73 pri_72 0xe000_e44c pri_79 pri_78 pri_77 pri_76 0xe000_e450 pri_83 pri_82 pri_81 pri_80 0xe000_e454 pri_87 pri_86 pri_85 pri_84 0xe000_e458 pri_81 pri_80 pri_89 pri_88 0xe000_e45c - pri_94 pri_93 pri_92 the number of bits to be used for assigning a priority varies with each product. this product uses three bits for assigning a priority. the following shows the fields of the interrupt priority registers for interrupt numbers 0 to 3. the interrupt priority registers for all other interrupt numbers have the identical fields. unused bits return ?0? when read, and writing to unused bits has no effect.
7 exceptions tmpm380/m382 tmpm380/m382 - 46 / 59 - 7 6 5 4 3 2 1 0 bit symbol pri_0 read/write r/w r after reset 0 0 function priority of interrupt number 0 ?0? is read. 15 14 13 12 11 10 9 8 bit symbol pri_1 read/write r/w r after reset 0 0 function priority of interrupt number 1 ?0? is read. 23 22 21 20 19 18 17 16 bit symbol pri_2 read/write r/w r after reset 0 0 function priority of interrupt number 2 ?0? is read. 31 30 29 28 27 26 25 24 bit symbol pri_3 read/write r/w r after reset 0 0 function priority of interrupt number 3 ?0? is read. priority of interrupt number 0 priority of interrupt number 1 priority of interrupt number 2 priority of interrupt number 3
tmpm380/m382 tmpm380/m382 - 47 / 59 - 7.6.2.18 vector table offset register 7 6 5 4 3 2 1 0 bit symbol tbloff read/write r/w r after reset 0 0 function offset value ?0? is read. 15 14 13 12 11 10 9 8 bit symbol tbloff read/write r/w after reset 0 function offset value 23 22 21 20 19 18 17 16 bit symbol tbloff read/write r/w after reset 0 function offset value 31 30 29 28 27 26 25 24 bit symbol tblba se tbloff read/write r r/w r/w after reset 0 0 0 function ?0? is read. table base offset value set the offset value from the top of the space specified in tblbase. the offset must be aligned based on the num ber of exceptions in the table. this means that the minimum alignment is 32 words that you can use for up to 16 interrupts. for more interrupts, it is ne cessary to adjust the alignment by rounding up to the next power of two. the vector table is in: 0 = code space 1 = sram space
7 exceptions tmpm380/m382 tmpm380/m382 - 48 / 59 - 7.6.2.19 system handler priority registers sys te m handler priority registers ha ve eight bits per each exception. the following shows the addresses of the system handler priority registers corresponding to each exception. 31 24 23 16 15 8 7 0 0xe000_ed18 pri_7 pri_6 (usage fault) pri_5 (bus fault) pri_4 (memory management) 0xe000_ed1c pri_11 (svcall) pri_10 pri_9 pri_8 0xe000_ed20 pri_15 (systick) pri_14 (pendsv) pri_13 pri_12 (debug monitor) the number of bits to be used for assigning a priority varies with each product. this product uses three bits for assigning a priority. the following shows the fields of the system handl er priority registers for memory management, bus fault and usage fault. the system handler priority regi sters for all other except ions have the identical fields. unused bits return ?0? when read, and writing to unused bits has no effect. 7 6 5 4 3 2 1 0 bit symbol pri_4 read/write r/w r after reset 0 0 function priority of memory management ?0? is read. 15 14 13 12 11 10 9 8 bit symbol pri_5 read/write r/w r after reset 0 0 function priority of bus fault ?0? is read. 23 22 21 20 19 18 17 16 bit symbol pri_6 read/write r/w r after reset 0 0 function priority of usage fault ?0? is read. 31 30 29 28 27 26 25 24 bit symbol pri_7 read/write r/w r after reset 0 0 function reserved ?0? is read.
tmpm380/m382 tmpm380/m382 - 49 / 59 - 7.6.2.20 system handler control and state register 7 6 5 4 3 2 1 0 bit symbol svcall act usgfau lt act busfau lt act memfau lt act read/write r/w r r/w r r/w r/w after reset 0 0 0 0 0 0 function svcall 0: inactive 1: active ?0? is read. usage fault 0: inactive 1: active ?0? is read. bus fault 0: inactive 1: active memory management 0: inactive 1: active 15 14 13 12 11 10 9 8 bit symbol svcall pended busfau lt pended memfau lt pended usgfau lt pended systick act pendsv act monito r act read/write r/w r/w r/w r/w r/w r/w r r/w after reset 0 0 0 0 0 0 0 0 function svcall 0: not pended 1: pended bus fault 0: not pended 1: pended memory management 0: not pended 1: pended usage fault 0: not pended 1: pended systick 0: inactive 1: active pendsv 0: inactive 1: active ?0? is read. debug monitor 0: inactive 1: active 23 22 21 20 19 18 17 16 bit symbol usgfau lt ena busfau lt ena memfau lt ena read/write r r/w r/w r/w after reset 0 0 0 0 function ?0? is read. usage fault 0: disable 1: enable bus fault 0: disable 1: enable memory management 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function ?0? is read.
7 exceptions tmpm380/m382 tmpm380/m382 - 50 / 59 - reads as ?1? if memory management is active. reads as ?1? if bus fault is active. reads as ?1? if usage fault is active. reads as ?1? if svcall is active. reads as ?1? if debug monitor is active. reads as ?1? if pendsv is active. reads as ?1? if systick is active. reads as ?1? if usage fault is pended. reads as ?1? if memory management is pended. reads as ?1? if bus fault is pended. reads as ?1? if svcall is pended. set to ?0? to disable or ?1? to enable memory management. set to ?0? to disable or ?1? to enable bus fault. set to ?0? to disable or ?1? to enable usage fault. (note) extreme caution is needed to clear or set the active bits, because clearing and setting these bits does not repair stack contents.
tmpm380/m382 tmpm380/m382 - 51 / 59 - 7.6.3 clock generator registers 7.6.3.1 cg interrupt mode control register a this resister set the clearing standby request ac tive level of external interrupt int0~int3. 7 6 5 4 3 2 1 0 cgimcga bit symbol emcg02 emcg01 emcg00 emst01 emst00 int0en 0x4004_0220 read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int0 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int0 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int0 clear input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcg12 emcg11 emcg10 emst11 emst10 int1en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int1 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int1 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int1 clear input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcg22 emcg21 emcg20 emst21 emst20 int2en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int2 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int2 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int2 clear input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcg32 emcg31 emcg30 emst31 emst30 int3en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int3 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int3 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int3 clear input 0: disable 1: enable (note1) refer to emstxx bit to know the active condition which is used for clearing standby. (note2) please specify the bit for the edge first and then specify the bit for the . setting them simultaneously is prohibited.
7 exceptions tmpm380/m382 tmpm380/m382 - 52 / 59 - 7.6.3.2 cg interrupt mode control register b this resister set the clearing standby request ac tive level of external interrupt int4~int7. 7 6 5 4 3 2 1 0 cgimcgb bit symbol emcg42 emcg41 emcg40 emst41 emst40 int4en 0x4004_0224 read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int4 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int4 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int4 clear input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcg52 emcg51 emcg50 emst51 emst50 int5en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int5 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int5 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int5 clear input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcg62 emcg61 emcg60 emst61 emst60 int6en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int6 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int6 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int6 clear input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcg72 emcg71 emcg70 emst71 emst70 int7en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int7 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int7 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int7 clear input 0: disable 1: enable (note1) refer to emstxx bit to know the active condition which is used for clearing standby. (note2) please specify the bit for the edge first and then specify the bit for the . setting them simultaneously is prohibited. (note3) int6 to int7 is for tmpm380 only . write "0" to bit[24][16] and "010" to bit[30:28][22:20] for tmpm382.
tmpm380/m382 tmpm380/m382 - 53 / 59 - 7.6.3.3 cg interrupt mode control register c this resister set the clearing standby request ac tive level of external interrupt int8~intb. 7 6 5 4 3 2 1 0 cgimcgc bit symbol emcg82 emcg81 emcg80 emst81 emst80 int8en 0x4004_0228 read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int8 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int8 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int8 clear input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcg92 emcg91 emcg90 emst91 emst90 int9en read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of int9 standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of int9 standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. int9 clear input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcga2 emcga1 emcga0 emsta1 emsta0 intaen read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of inta standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of inta standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. inta clear input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcgb2 emcgb1 emcgb0 emstb1 emstb0 intben read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intb standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of intb standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. intb clear input 0: disable 1: enable (note1) refer to emstxx bit to know the active condition which is used for clearing standby. (note2) please specify the bit for the edge first and then specify the bit for the . setting them simultaneously is prohibited. (note3) int9 to intb is for tmpm380 only . write "0" to bit[24][16][8] and "010" to bit[30:28][22:20][14:12] for tmpm382.
7 exceptions tmpm380/m382 tmpm380/m382 - 54 / 59 - 7.6.3.4 cg interrupt mode control register d this resister set the clearing standby request ac tive level of external interrupt intc~intf. 7 6 5 4 3 2 1 0 cgimcgd bit symbol emcgc2 emcgc1 emcgc0 emstc 1 emstc 0 intcen 0x4004_022c read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intc standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of intc standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. intc clear input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcgd2 emcgd1 emcgd0 emstd 1 emstd 0 intden read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intd standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of intd standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. intd clear input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcge2 emcge1 emcge0 emste1 emste0 inteen read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of inte standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of inte standby clear request 00: 01: rising edge 10: falling edge 11: both edges ?0? is read inte clear input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcgf2 emcgf1 emcgf0 emstf1 emstf0 intfen read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intf standby clear request. (101~111: setting prohibited) 000: ?l? level 001: ?h? level 010: falling edge 011: rising edge 100: both edges active state of intf standby clear request 00: 01: rising edge 10: falling edge 11: both edges reads as undefined. intf clear input 0: disable 1: enable (note1) refer to emstxx bit to know the active condition which is used for clearing standby. (note2) please specify the bit for the edge first and then specify the bit for the . setting them simultaneously is prohibited. (note3) intc to inte is for tmpm380 only . write "0" to bit[16][8][0] and "010" to bit[22:20][14:12][6:4] for tmpm382.
tmpm380/m382 tmpm380/m382 - 55 / 59 - 7.6.3.5 cg interrupt mode control register e this resi ster set the clearing standby request active level of interrupt int rt c , int rmcrx . 7 6 5 4 3 2 1 0 cgimcge bit symbol emcgr tc2 emcgr tc1 emcgr tc0 emsrt tc1 emstr tc0 intrtc en 0x4004_0230 read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intrtc standb y clear request. write ?010? ?? 010: falling edge active state of intrtc standby clear request 00: 01: 10: falling edge 11: reads as undefined. intrtc clear input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcgr mcrx2 emcgr mcrx1 emcgr mcrx0 emstr mcrx1 emstr mcrx0 intrmc rxen read/write r r/w r r r/w after reset 0 0 1 0 0 0 undefined 0 function ?0? is read active state setting of intrmcrx standby clear request. write ?011? ? 011: rising edge active state of intrmcrx standby clear r equest 00: 01: rising edge 10: 11: reads as undefined. intrmcrx clear input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol read/write r r/w r r r/w after reset 0 0 1 0 0 0 0 0 function ?0? is read write any value. ?00? is read. ?0? is read. write ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r r/w r r r/w after reset 0 0 1 0 0 0 0 0 function ?0? is read write any value. ?00? is read. ?0? is read. write ?0?. (note1) refer to emstxx bit to know the active condition which is used for clearing standby. (note2) please specify the bit for the edge first and then specify the bit for the . setting them simultaneously is prohibited.
7 exceptions tmpm380/m382 tmpm380/m382 - 56 / 59 - be sure to set active state of the standby clear req uest, in case the interrupt is enabled for clearing the standby modes. (note 1) when using interrupts, be sure to follow the sequence of actions shown below: 1) if the external intrrupt request pin shared wi th other general ports, enable the port to receive the interrupt. 2) set conditions such as active state upon initialization. 3) clear interrupt requests. 4) enable interrupts. (note 2) each settings must be performed while interrupts are disabled. (note 3) for clearing the standby modes , 18 inte rrupt factors (int0 to intf,intrtc,intrmcrx) are available. cgimcga~cgimcge resisters in cg ar e used for selecting edge/level of active state and which aforementioned factors are used for clearing the standby modes. (note 4) in case the standby mode clear is not requi red, interrupt factors (int0 to intf,intrtc,intrmcrx) can be used as a normal interrupt without setting cgimcga~cgimcge resisters in cg.
tmpm380/m382 tmpm380/m382 - 57 / 59 - 7.6.3.6 cg interrupt request clear register this resi ster clear the interrupt reque st from int0~intf ,intrtc, intrmcrx. 7 6 5 4 3 2 1 0 cgicrcg bit symbol icrcg4 icrcg3 icrcg2 i crcg1 icrcg0 read/write r w after reset 0 0 0 0 0 0 clear interrupt requests 0_0000:int0 0_0001:int1 0_0010:int2 0_0011:int3 0_0100:int4 0_0101:int5 0_0110:int6 (note1) 0_0111:int7 (note1) 0_1000:int8 0_1001:int9 (note1) 0_1010:inta (note1) 0_1011:intb (note1) 0_1100:intc (note1) 0_1101:intd (note1) 0_1110:inte (note1) 0_1111:intf 1_0000:intrtc 1_0001:intrmcrx function ?0? is read. 1_0010 1_1111: setting prohibited * ?0? is read. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function ?0? is read. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function ?0? is read. (note1) for tmpm380.
7 exceptions tmpm380/m382 tmpm380/m382 - 58 / 59 - 7.6.3.7 nmi flag register nmi flag resi ster is a resister for reading nmi generation status. cgnmiflg 7 6 5 4 3 2 1 0 bit symbol nmiflg2 - nmiflg0 read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. nmi factor generation flag 0: not applicable 1: generated from voltage level detection - nmi factor generation flag 0:not applicable 1: generated from wdt 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. (note) are clear ed to ?0? when they are read.
tmpm380/m382 tmpm380/m382 - 59 / 59 - 7.6.3.8 reset flag register re set flag resi ster is a resister for reading inter nal reset generation status per generation factors. since this register is not cleared automatically, it is necceary to write ?0? to clear the register. cgrstflg 7 6 5 4 3 2 1 0 bit symbol ofdrstf dbgrstf - wdtrstf pinrstf ponrstf read/write r r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 1 function ?0? is read. ofd reset flag 0:?0? is written 1:reset from ofd debug reset flag 0: ?0? is written 1:reset from sysrstr q write ?0?. wdt reset flag 0:?0? is written 1:reset from wdt reset pin flag 0: ?0? is written 1:reset from reset pin power on reset flag 0: ?0? is written 1:reset from power on reset 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 0 0 0 0 0 0 0 function ?0? is read. (note1) (note2) the tmpm380 has power-on reset circuit and this register is initialized only by power-on reset. therefore, ?1? is set to the bi t in initial reset state right after power-on. this bit is not set by the second and subsequent resets . sysrstrq is occurred by set to sysresetreq bit in nvic.
tmpm380/m382 tmpm380/m382 - 1 / 52 - 8 input/output ports 8.1 port registers pxdata : port data register to read/write port data. pxcr : output control register to control enable/disable output. * to enable/disable input, controled by pxie register. pxfrn : function control register to set functions. an assigned function can be activated by setting ?1?. pxod : open drain control register to switch cmos output or open drain output. pxpup : port pull-up control register to enable/disable pull-up resister. pxpdn : port pull-down control register to enable/disable pull-down resister. pxie : input enable control register to enable/disable input. default setting is disabled for avoiding through current.
8 input/output ports tmpm380/m382 tmpm380/m382 - 2 / 52 - 8.2 port functions 8.2.1 port status in stop mode input and output in stop mode are enabled/disabl ed by the cgstbycr bit in the standby control register if pxie or pxcr is enabled with =1, input or output is enabled respectively in stop mode. if =0, both input and output are disabled in st op mode except for some ports even if pxie and pxcr are enabled. the differences are summarized in the table shown below. table 8-1 port status in stop mode pin name i/o =0 =1 control pins reset, mode input only x1,xt1 input only oscillator x2, xt2 output only ?h? level output ?h? level output input depends on pxie. ports pan to ppn output depends on pxcr. input depends on pxie debag interface tms/swdio/tdo/swv output external interrupts int0 to intf input depends on pxie. depends on pxie. ssp spnclk/spnfss/spndo output gemgn ______________ input depends on pxie. mpt(igbt) mtnoutxx output emgn ___________ input depends on pxie. mpt(pmd) uon/von/won/xon/yon/zon output input depends on pxie. others output depends on pxcr. input or output enabled input or output disabled. depend on pxcr and enabled when data is valid. n bit number
tmpm380/m382 tmpm380/m382 - 3 / 52 - 8.2.2 port a (pa0 to pa7) the port a is a general-purpose, 8-bit input/output port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port a performs the serial interface function and the external interrupt input and 16-bit timer input and 16-bit timer output. reset initializes all bits of the port a as genera l-purpose ports with input, output, pull-up and pull-down disabled. to use the external interrupt input for releasing stop mode, select this function in the pafr2 register and enable input in the paie register. these settings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enabled in pxie. make sure to disable unused interrupts when programming the device. port a register 7 6 5 4 3 2 1 0 padata bit symbol pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 (0x4000_0000) read/write r/w after reset ?0? port a control register 7 6 5 4 3 2 1 0 pacr bit symbol pa7c pa6c pa5c pa4c pa3c pa2c pa1c pa0c (0x4000_0004) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port a function register 1 7 6 5 4 3 2 1 0 pafr1 bit symbol pa6f1 pa6f1 pa5f1 pa4f1 pa3 f1 pa2f1 pa1f1 pa0f1 (0x4000_0008) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:port 1:tb4in 0:port 1:rxd1 0:port 1:txd1 0:port 1:sclk1 0:port 1:tb1out 0:port 1:tb1in 0:port 1:tb0out 0:port 1:tb0in
8 input/output ports tmpm380/m382 tmpm380/m382 - 4 / 52 - port a function register 2 7 6 5 4 3 2 1 0 pafr bit symbol pa7f2 pa6f2 pa5f2 pa4f2 pa3 f2 pa2f2 pa1f2 pa0f2 (0x4000_000c) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:port 1 int8 0:port 1:tb6in 0:port 1:tb6out 0:port 1:cts1 0:port 1:rxin 0:port 1:int4 0:port 1:scout 0:port 1:int3 port a open drain control register 7 6 5 4 3 2 1 0 paod bit symbol pa7od pa6od pa5od pa4od pa3od pa2od pa1od pa0od (0x4000_ 0028) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1: open drain port a pull-up control register 7 6 5 4 3 2 1 0 papup bit symbol pa7up pa6up pa5up pa4up pa3up pa2up pa1up pa0up (0x4000_002c) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0: disabled 1: enabled port a pull-down control register 7 6 5 4 3 2 1 0 papdn bit symbol pa7dn pa6dn pa5dn pa4dn pa3dn pa2dn pa1dn pa0dn (0x4000_0030) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0: disabled 1: enabled port a input enable control register 7 6 5 4 3 2 1 0 paie bit symbol pa7ie pa6ie pa5ie pa4ie pa3ie pa2ie pa1ie pa0ie (0x4000_0038) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0: disabled 1: enabled
tmpm380/m382 tmpm380/m382 - 5 / 52 - 8.2.3 port b (pb0 to pb7) the port b is a general-purpose, 8-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port b performs the debug communication function and the debug trace output function. reset initializes pb3, pb4, pb5, pb6 and pb7 to perform debug communication function.when pb3 functions as the tms or swdio, input, output and pull-up are enabled. when pb4 functions as the tck or swclk, input, pull-down are enabled. when pb5 functions as the tdo or swv, output is enabled. when pb6 functions tdi, input, pull-up are enabled. when pb7 functions as trst input, pull-up is enabled. pb0, pb1, pb2 perform as the general-purpose ports with input, output and pull-up disabled. (note 1) the default setting for pb3 is function port. input, output, and pull-up are enabled. (note 2) the default setting for pb4 is function port. input, and pull-down are enabled. (note 3) the default setting for pb5 is function port. output is enabled. (note 4) the default setting for pb6 and pb7 are function port. input and pull-up are enabled. (note 5) if pb3 and pb5 are configured to function port for debug function, outputs are enabled even during stop mode regardless of the cgstbycr bit setting. port b register 7 6 5 4 3 2 1 0 pbdata bit symbol pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 (0x4000_0040) read/write r/w after reset ?0? port b control register 7 6 5 4 3 2 1 0 pbcr bit symbol pb7c pb6c pb5c pb4c pb3c pb2c pb1c pb0c (0x4000_0044) read/write r/w after reset 0 0 1 0 1 0 0 0 function output 0: disabled 1: enabled
8 input/output ports tmpm380/m382 tmpm380/m382 - 6 / 52 - port b function register 1 7 6 5 4 3 2 1 0 pbfr1 bit symbol pb7f1 pb6f1 pb5f1 pb4f1 pb3 f1 pb2f1 pb1f1 pb0f1 (0x4000_0048) read/write r/w after reset 1 1 1 1 1 0 0 0 function 0:port 1:trst 0:port 1:tdi 0:port 1:tdo/ swv 0:port 1:tck/ swclk 0:port 1:tms/ swdio 0:port 1:trace data1 0:port 1:trace data0 0:port 1:trace clk port b open drain control register 7 6 5 4 3 2 1 0 pbod bit symbol pb7od pb6od pb5od pb4od pb3 od pb2od pb1od pb0od (0x4000_ 0068) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1: open drain port b pull-up control register 7 6 5 4 3 2 1 0 pbpup bit symbol pb7up pb6up pb5up pb4up pb3up pb2up pb1up pb0up (0x4000_006c) read/write r/w after reset 1 1 0 0 1 0 0 0 function pull-up 0: disabled 1: enabled port b pull-down control register 7 6 5 4 3 2 1 0 pbpdn bit symbol pb7dn pb6dn pb5dn pb4dn pb3dn pb2dn pb1dn pb0dn (0x4000_0070) read/write r/w after reset 0 0 0 1 0 0 0 0 function pull-down 0: disabled 1: enabled port b input enable control register 7 6 5 4 3 2 1 0 pbie bit symbol pb7ie pb6ie pb5ie pb4ie pb3ie pb2ie pb1ie pb0ie (0x4000_0078) read/write r/w after reset 1 1 0 1 1 0 0 0 function input 0: disabled 1: enabled
tmpm380/m382 tmpm380/m382 - 7 / 52 - 8.2.4 port c (pc0 to pc7) the port c is a general-purpose, 8-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the ports c perform the input/output port for three-phase moter control (mpt:pmd), input/output port for igbt control (mpt),general-purpose timer inpu t/output and synchronous serial bus interface (ssp) function. . reset initializes all bits of the port c as gener al-purpose ports with input, output, pull-up and pull-down disabled. port c register 7 6 5 4 3 2 1 0 pcdata bit symbol pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 (0x4000_0080) read/write r/w after reset ?0? port c control register 7 6 5 4 3 2 1 0 pccr bit symbol pc7c pc6c pc5c pc4c pc3c pc2c pc1c pc0c (0x4000_0084) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port c function register 1 7 6 5 4 3 2 1 0 pcfr1 bit symbol - pc6f1 pc5f1 pc4f1 pc3f1 pc2f1 pc1f1 pc0f1 (0x4000_0088) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1:emg0 0:port 1:zo0 0:port 1:wo0 0:port 1:yo0 0:port 1:vo0 0:port 1:xo0 0:port 1:uo0 port c function register 2 7 6 5 4 3 2 1 0 pcfr2 bit symbol pc7f2 pc6f2 pc5f2 pc4f2 pc3f2 pc2f2 pc1f2 pc0f2 (0x4000_008c) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:port 1:mt0in 0:port 1:gemg0 0:port 1:mtout 10 0:port 1:mtout 00 0:port 1:sp0fss 0:port 1:sp0clk 0:port 1:sp0di 0:port 1:sp0do
8 input/output ports tmpm380/m382 tmpm380/m382 - 8 / 52 - port c function register 3 7 6 5 4 3 2 1 0 pcfr3 bit symbol - - pc5f3 pc4f3 - pc2f3 pc1f3 pc0f3 (0x4000_0090) read/write r r/w r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1:mttb0i n 0:port 1:mttb0o ut ?0? is read 0:port 1:sck0 0:port 1:si0/scl 0 0:port 1:so0/sd a0 port c function register 4 7 6 5 4 3 2 1 0 pcfr4 bit symbol pc7f4 pc6f4 pc5f4 - - - - - (0x4000_0094) read/write r/w r after reset 0 0 0 0 0 0 0 0 function 0:port 1:rx4 0:port 1:tx4 0:port 1:sclk4 ?0? is read port c function register 5 7 6 5 4 3 2 1 0 pcfr5 bit symbol - - pc5f4 - - - - - (0x4000_0098) read/write r r/w r after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1:cts4 ?0? is read port c open drain control register 7 6 5 4 3 2 1 0 pcod bit symbol pc7od pc6od pc5od pc4od pc3od pc2od pc1od pc0od (0x4000_ 00a8) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1:open drain port c pull-up control register 7 6 5 4 3 2 1 0 pcpup bit symbol pc7up pc6up pc5up pc4up pc3up pc2up pc1up pc0up (0x4000_00ac) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0: disabled 1: enabled
tmpm380/m382 tmpm380/m382 - 9 / 52 - port c pull-down control register 7 6 5 4 3 2 1 0 pcpdn bit symbol pc7dn pc6dn pc5dn pc4dn pc3dn pc2dn pc1dn pc0dn (0x4000_00b0 read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0: disabled 1: enabled port c input enable control register 7 6 5 4 3 2 1 0 pcie bit symbol pc7ie pc6ie pc5ie pc4ie pc3ie pc2ie pc1ie pc0ie (0x4000_00b8) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
8 input/output ports tmpm380/m382 tmpm380/m382 - 10 / 52 - 8.2.5 port d (pd0 to pd6) the port d is a general-purpose, 7-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port d performs the serial interface function, 16-bit timer input/out put, the external interrupt input and encoder input. reset initializes all bits of the port d as gener al-purpose ports with input, output, pull-up and pull-down disabled. to use the external interrupt input for releasing st op mode, select this function in the pdfr1,pdfr3 register and enable input in the pdie register. thes e settings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enabled in pxie. make sure to disable unused interrupts when programming the device. port d register 7 6 5 4 3 2 1 0 pddata bit symbol - pd6 pd5 pd4 pd3 pd2 pd1 pd0 (0x4000_00c0) read/write r r/w after reset ?0? is read. ?0? port d control register 7 6 5 4 3 2 1 0 pdcr bit symbol pd6c pd5c pd4c pd3c pd2c pd1c pd0c (0x4000_00c4) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. output 0: disabled 1: enabled port d function register 1 7 6 5 4 3 2 1 0 pdfr1 bit symbol pd6f1 pd5f1 pd4f1 pd3f1 pd2f1 pd1f1 pd0f1 (0x4000_00c8) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. 0:port 1:rxd2 0:port 1:txd2 0:port 1:sclk2 0:port 1:int9 0:port 1:encz0 0:port 1:encb0 0:port 1:enca0 (important) tmpm382 (64 pin version) does not implement port d (pd0 to pd6). please do not use these functions if you use this product.
tmpm380/m382 tmpm380/m382 - 11 / 52 - port d function register 2 7 6 5 4 3 2 1 0 pdfr bit symbol pd4f2 pd1f2 pd0f2 (0x4000_00cc) read/write r r/w r r/w r/w after reset 0 0 0 0 0 function ?0? is read. 0:port 1:cts2 ?0? is read. 0:port 1:tb5out 0:port 1: tb5in port d function register 3 7 6 5 4 3 2 1 0 pdfr3 bit symbol pd2f1 pd0f1 (0x4000_00d0) read/write r r/w r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. 0:port 1:intd ?0? is read. 0:port 1:intc port d open drain control register 7 6 5 4 3 2 1 0 pdod bit symbol pd6od pd5od pd4od pd3od pd2od pd1od pd0od (0x4000_ 00e8) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. 0:cmos 1: open drain port d pull-up control register 7 6 5 4 3 2 1 0 pdpup bit symbol - pd6up pd5up pd4up pd3up pd2up pd1up pd0up (0x4000_00ec) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. pull-up 0:disabled 1:enabled port d pull-down control register 7 6 5 4 3 2 1 0 pdpdn bit symbol - pd6dn pd5dn pd4dn pd3dn pd2dn pd1dn pd0dn (0x4000_00f0) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. pull-down 0:disabled 1:enabled
8 input/output ports tmpm380/m382 tmpm380/m382 - 12 / 52 - port d input enable control register 7 6 5 4 3 2 1 0 pdie bit symbol - pd6ie pd5ie pd4ie pd3ie pd2ie pd1ie pd0ie (0x4000_00f8) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read. input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 13 / 52 - 8.2.6 port e (pe0 to pe7) the port e is a general-purpose, 8-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port e performs the serial interface function, timer input/output and the external interrupt input. reset initializes all bits of the port e as genera l-purpose ports with input, output, pull-up and pull-down disabled. to use the external interrupt input for releasing stop mode, select this function in the pefr2 register and enable input in the peie register. these settings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enabled in pxie. make sure to disable unused interrupts when programming the device. port e circuit type 7 6 5 4 3 2 1 0 type port e register 7 6 5 4 3 2 1 0 pedata bit symbol pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 (0x4000_0100) read/write r/w after reset ?0? port e control register 7 6 5 4 3 2 1 0 pecr bit symbol pe7c pe6c pe5c pe4c pe3c pe2c pe1c pe0c (0x4000_0104) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port e functions register 1 7 6 5 4 3 2 1 0 pefr1 bit symbol pe7f1 pe6f1 pe5f1 pe4f1 pe3 f1 pe2f1 pe1f1 pe0f1 (0x4000_0108) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:port 1:tb3out. 0:port 1:tb3in 0:port 1:tb2out 0:port 1: tb2in 0:port 1:tb4out 0:port 1:sclk0 0:port 1:rxd0 0:port 1: txd0 (important) tmpm382 (64 pin version) does not implement pe6 and pe7. please do not use these functions if you use this product.
8 input/output ports tmpm380/m382 tmpm380/m382 - 14 / 52 - port e functions register 2 7 6 5 4 3 2 1 0 pefr2 bit symbol pe7f2 pe6f2 pe4f2 pe2f2 (0x4000_010c) read/write r/w r/w r r/w r r/w r after reset 0 0 0 0 0 0 0 function 0:port 1:int7. 0:port 1:int6 ?0? is read. 0:port 1:int5 ?0? is read. 0:port 1:cts0 ?0? is read. port e open drain control register 7 6 5 4 3 2 1 0 peod bit symbol pe7od pe6od pe5od pe4od pe3 od pe2od pe1od pe0od (0x4000_ 0128) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1:open drain port e pull-up control register 7 6 5 4 3 2 1 0 pepup bit symbol pe7up pe6up pe5up pe4up pe3up pe2up pe1up pe0up (0x4000_012c) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0:disabled 1:enabled port e pull-down control register 7 6 5 4 3 2 1 0 pepdn bit symbol pe7dn pe6dn pe5dn pe4dn pe3dn pe2dn pe1dn pe0dn (0x4000_0130) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0:disabled 1:enabled port e input enable control register 7 6 5 4 3 2 1 0 peie bit symbol pe7ie pe6ie pe5ie pe4ie pe3ie pe2ie pe1ie pe0ie (0x4000_0138) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 15 / 52 - 8.2.7 port f (pf0 to pf4) the port f is a general-purpose, 5-bit input/output port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port f performs the functions of the serial interface, timer input/output encoder input and alarm output. reset initializes all bits of the port f as genera l-purpose ports with input, output, pull-up and pull-down disabled. port f circuit type 7 6 5 4 3 2 1 0 type port f register 7 6 5 4 3 2 1 0 pfdata bit symbol pf4 pf3 pf2 pf1 pf0 (0x4000_0140) read/write r r/w after reset ?0? is read. ?0? port f control register 7 6 5 4 3 2 1 0 pfcr bit symbol pf4c pf3c pf2c pf1c pf0c (0x4000_0144) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read. output 0: disabled 1: enabled port f function register 1 7 6 5 4 3 2 1 0 pffr1 bit symbol pf4f1 pf3f1 pf2f1 pf1f1 pf0f1 (0x4000_0148) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read. 0:port 1: encz1 0:port 1: encb1 0:port 1: enca1 0:port 1:tb7out 0:port 1: tb7in port f function register 2 7 6 5 4 3 2 1 0 pffr2 bit symbol pf4f2 pf3f2 pf2f2 pf2f2 (0x4000_014c) read/write r r/w r after reset 0 0 0 0 0 0 function ?0? is read. 0:port 1:rxd3 0:port 1:txd3 0:port 1:sclk3 .0:port 1:alarm ?0? is read (important) tmpm382 (64 pin version) does not implement pf2,pf3 and pf4. please do not use these functions if you use this product.
8 input/output ports tmpm380/m382 tmpm380/m382 - 16 / 52 - port f function register 3 7 6 5 4 3 2 1 0 pffr3 bit symbol pf2f3 (0x4000_0150) read/write r r/w r after reset 0 0 0 function ?0? is read. 0:port 1:cts3 ?0? is read. port f open drain control register 7 6 5 4 3 2 1 0 pfod bit symbol pf4od pf3od pf2od pf1od pf0od (0x4000_0168) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read 0:cmos 1:open drain port f pull-up control register 7 6 5 4 3 2 1 0 pfpup bit symbol pf4up pf3up pf2up pf1up pf0up (0x4000_016c) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read pull-up 0:disabled 1:enabled port f pull-down control register 7 6 5 4 3 2 1 0 pfpdn bit symbol pf4dn pf3dn pf2dn pf1dn pf0dn (0x4000_0170) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read pull-down 0:disabled 1:enabled port f input enable control register 7 6 5 4 3 2 1 0 pfie bit symbol pf4ie pf3ie pf2i e pf1ie pf0ie (0x4000_0178) read/write r r/w after reset 0 0 0 0 0 0 function ?0? is read input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 17 / 52 - 8.2.8 port g (pg0 to pg7) the port g is a general-purpose, 8-bit input/ output port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port g performs the input/output port for three-phase moter control (mpt :pmd), input/output port for igbt control (mpt), timer input/output, and serial interface function. reset initializes all bits of the port g as general-purpose ports with input, output, pull-up and pull-down disabled. port g circuit type 7 6 5 4 3 2 1 0 type port g register 7 6 5 4 3 2 1 0 pgdata bit symbol pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 (0x4000_0180) read/write r/w after reset ?0? port g control register 7 6 5 4 3 2 1 0 pgcr bit symbol pg7c pg6c pg5c pg4c pg3c pg2c pg1c pg0c (0x4000_0184) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port g function register 1 7 6 5 4 3 2 1 0 pgfr1 bit symbol - pg6f1 pg5f1 pg4f1 pg3f1 pg2f1 pg1f1 pg0f1 (0x4000_0188) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1: emg1 0:port 1: zo1 0:port 1: wo1 0:port 1: yo1 0:port 1: vo1 0:port 1: xo1 0:port 1: uo1 port g function register 2 7 6 5 4 3 2 1 0 pgfr2 bit symbol pg7f2 pg6f2 pg5f2 pg4f2 - - - - (0x4000_018c) read/write r/w r after reset 0 0 0 0 0 0 0 0 function 0:port 1: mt1in 0:port 1: gemg1 0:port 1: mtout01 0:port 1: mtout00 ?0? is read (important) tmpm382 (64 pin version) does not implement port g (pg0 to pg7). please do not use these functions if you use this product.
8 input/output ports tmpm380/m382 tmpm380/m382 - 18 / 52 - port g function register 3 7 6 5 4 3 2 1 0 pgfr3 bit symbol - - pg5f1 pg4f1 - pg2f1 pg1f1 pg0f1 (0x4000_0190) read/write r r/w r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1: mttb1in 0:port 1:mttb1 out ?0? is read 0:port 1: sck1 0:port 1:si1/scl 1 0:port 1: so1/sda 1 port g open drain control register 7 6 5 4 3 2 1 0 pgod bit symbol pg7od pg6od pg5od pg4od p g3od pg2od pg1od pg0od (0x4000_01a8) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1:open drain port g pull-up control register 7 6 5 4 3 2 1 0 pgpup bit symbol pg7up pg6up pg5up pg4up pg3up pg2up pg1up pg0up (0x4000_01ac) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0:disabled 1:enabled port g pull-down control register 7 6 5 4 3 2 1 0 pgpdn bit symbol pg7dn pg6dn pg5dn pg4dn pg3dn pg2dn pg1dn pg0dn (0x4000_01b0) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0:disabled 1:enabled port g input enable control register 7 6 5 4 3 2 1 0 pgie bit symbol pg7ie pg6ie pg5ie pg4ie p g3ie pg2ie pg1ie pg0ie (0x4000_01b8) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 19 / 52 - 8.2.9 port h (ph0 to ph7) the port h is a general-purpose 8-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port h performs the analog input of the a/d converter and the external interrupt input. reset initializes all bits of the port h as gener al-purpose ports with input, output, pull-up and pull-down disabled. to use the external interrupt input for releasing stop mode, select this function in the phfr1 register and enable input in the phie register. these se ttings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note 1) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enable d in pxie. make sure to disable unused interrupts when programming the device. (note 2) unless you use all the bits of port h as analog input pins, conversion accuracy may be reduced. be sure to verify that this causes no problem on your system. port h register 7 6 5 4 3 2 1 0 phdata bit symbol ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 (0x4000_01c0) read/write r/w after reset ?0? port h control register 7 6 5 4 3 2 1 0 phcr bit symbol ph7c ph6c ph5c ph4c ph3c ph2c ph1c ph0c (0x4000_01c4) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port h function register 1 7 6 5 4 3 2 1 0 phfr1 bit symbol - - - - - ph2f1 ph1f1 ph0f1 (0x4000_01c8) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:port 1:int2 0:port 1:int1 0:port 1:int0
8 input/output ports tmpm380/m382 tmpm380/m382 - 20 / 52 - port h open drain control register 7 6 5 4 3 2 1 0 phod bit symbol ph7od ph6od ph5od ph4od ph3od ph2od ph1od ph0od (0x4000_ 01e8) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1: open drain port h pull-up control register 7 6 5 4 3 2 1 0 phpup bit symbol ph7up ph6up ph5up ph4up ph3up ph2up ph1up ph0up (0x4000_01ec) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0:disabled 1:enabled port h pull-down control register 7 6 5 4 3 2 1 0 phpdn bit symbol ph7dn ph6dn ph5dn ph4dn ph3dn ph2dn ph1dn ph0dn (0x4000_01f0) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0:disabled 1:enabled port h input enable control register 7 6 5 4 3 2 1 0 phie bit symbol ph7ie ph6ie ph5ie ph4ie ph3ie ph2ie ph1ie ph0ie (0x4000_01f8) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 21 / 52 - 8.2.10 port i (pi0 to pi1) the port i is a general-purpose, 2-bit inpu t/output port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port i performs the analog input of the a/d converter. reset initializes all bits of the port i as genera l-purpose ports with input, output, pull-up and pull-down disabled. (note) unless you use all the bits of port i as analog input pins, conversion accuracy may be reduced. be sure to verify that this causes no problem on your system. port i register 7 6 5 4 3 2 1 0 pidata bit symbol pi1 pi0 (0x4000_0200) read/write r r/w after reset ?0? is read ?0? port i control register 7 6 5 4 3 2 1 0 picr bit symbol pi1c pi0c (0x4000_0204) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read output 0: disabled 1: enabled port i open drain control register 7 6 5 4 3 2 1 0 piod bit symbol pi1od pi0od (0x4000_ 0228) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:cmos 1:open drain
8 input/output ports tmpm380/m382 tmpm380/m382 - 22 / 52 - port i pull-up control register 7 6 5 4 3 2 1 0 pipup bit symbol pi1up pi0up (0x4000_022c) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-up 0: disabled 1: enabled port i pull-down control register 7 6 5 4 3 2 1 0 pipdn bit symbol pi1dn pi0dn (0x4000_0230) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-down 0:disabled 1:enabled port i input enable control register 7 6 5 4 3 2 1 0 piie bit symbol pi1ie pi0ie (0x4000_0238) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 23 / 52 - 8.2.11 port j (pj0 to pj7) the port j is a general-purpose, 8-bit input/output port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port j performs the analog input of the a/d converter and external interrupt input. reset initializes all bits of the port j as genera l-purpose ports with input, output, pull-up and pull-down disabled. to use the external interrupt input for releasing stop mode, select this function in the pjfr1 register and enable input in the pjie register. these se ttings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note 1) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enable d in pxie. make sure to disable unused interrupts when programming the device. (note 2) unless you use all the bits of port j as analog input pins, conversion accuracy may be reduced. be sure to verify that this causes no problem on your system. port j register 7 6 5 4 3 2 1 0 pjdata bit symbol pj7 pj6 pj5 pj4 pj3 pj2 pj1 pj0 (0x4000_0240) read/write r/w after reset ?0? port j control register 7 6 5 4 3 2 1 0 pjcr bit symbol pj7c pj6c pj5c pj4c pj3c pj2c pj1c pj0c (0x4000_0244) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port j function register 1 7 6 5 4 3 2 1 0 pjfr1 bit symbol pj7f1 pj6f1 (0x4000_0248) read/write r/w r after reset 0 0 0 0 0 0 0 0 function 0:port 1:intb 0:port 1:inta ?0? is read (important) tmpm382 (64 pin version) does not implement port j (pj0 to pj7). please do not use these functions if you use this product.
8 input/output ports tmpm380/m382 tmpm380/m382 - 24 / 52 - port j open drain control register 7 6 5 4 3 2 1 0 pjod bit symbol pj7od pj6od pj5od pj4od pj3od pj2od pj1od pj0od (0x4000_ 0268) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1:open drain port j pull-up control register 7 6 5 4 3 2 1 0 pjpup bit symbol pj7up pj6up pj5up pj4up pj3up pj2up pj1up pj0up (0x4000_026c) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0:disabled 1:enabled port j pull-down control register 7 6 5 4 3 2 1 0 pjpdn bit symbol pj7dn pj6dn pj5dn pj4dn pj3dn pj2dn pj1dn pj0dn (0x4000_0270) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0:disabled 1:enabled port j input enable control register 7 6 5 4 3 2 1 0 pjie bit symbol pj7ie pj6ie pj5ie pj4ie pj3ie pj2ie pj1ie pj0ie (0x4000_0278) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 25 / 52 - 8.2.12 port l(pl0, pl2) the port l is a general-purpose 2- bit port that contained 1-bit output port and 1-bit input/output port. for this port, inputs can be specified in units of bits . besides the general-purpose input function, the port l performs the functions as the external interrupt input and the operation mode setting. while a reset signal is in ?0?state, the pl0 input and pull-up are enabled. at the rising edge of the reset signal, if pl0 is ?1?, the device enters single mode and boots from the on-ch ip flash memory. if pl0 is ?0?, the device enters single boot mode and boots from the inte rnal boot program. for details of single boot mode, refer to ?flash memory operation?. reset initializes the port l0 as general-purpose out put with output disabled , pull-up enabled. reset initializes the port l2 as general-purpose input/output port with input disabled. to use the external interrupt input for releasing stop mode, select this function in the plfr1 register and enable input in the plie register. these se ttings enable the interrupt input even if the cgstbycr bit in the clock/mode control block is set to stop driving of pins during stop mode. (note) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enabled in pxie. make sure to disable unused interrupts when programming the device. port l register 7 6 5 4 3 2 1 0 pldata bit symbol pl2 pl0 (0x4000_02c0) read/write r r/w r r/w after reset ?0? is read 0 ?0? is read 0 port l control register 7 6 5 4 3 2 1 0 plcr bit symbol pl2c pl0c (0x4000_02c4) read/write r r/w r r/w after reset 0 0 0 0 function ?0? is read. output 0: disabled ? 1: enabled ?0? is read output 0: disabled ? 1: enabled port l function register 1 7 6 5 4 3 2 1 0 plfr1 bit symbol pl2f1 (0x4000_02c8) read/write r r/w r after reset 0 0 0 function ?0? is read 0:port 1: intf ?0? is read
8 input/output ports tmpm380/m382 tmpm380/m382 - 26 / 52 - port l open drain control register 7 6 5 4 3 2 1 0 plod bit symbol pl2od pl0od (0x4000_ 02e8) read/write r r/w r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:cmos 1:open drain ?0? is read 0:cmos 1:open drain port l pull-up control register 7 6 5 4 3 2 1 0 plpup bit symbol pl2up pl0up (0x4000_02ec) read/write r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-up 0:disabled 1:enabled 0? is read pull-up 0:disabled 1:enabled port l pull-down control register 7 6 5 4 3 2 1 0 plpdn bit symbol pl2dn pl0dn (0x4000_02f0) read/write r r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-down 0:disabled 1:enabled 0? is read pull-down 0:disabled 1:enabled port l input enable control register 7 6 5 4 3 2 1 0 plie bit symbol pl2ie (0x4000_02f8) read/write r r/w r after reset 0 0 0 0 function ?0? is read input 0:disabled 1:enabled ?0? is read
tmpm380/m382 tmpm380/m382 - 27 / 52 - 8.2.13 port m (pm0 to pm1) the port m is a general-purpose, 2-bit input/ output port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port i performs the high-speed oscillator1 (x1 and x2).(note1) while cgosccr is set to "1",each resister of portm ca nnot be changed.if you use the external high-speed oscillator,r efer to "6.clock/mode control" reset initializes all bits of the port m as general-purpose ports with input, output, pull-up, pull-down and high-speed oscillator1 disabled.(note 2) (note 1) the external high-speed oscillator must not be changed while portm is high output. (note 2) after reset,the high-speed clock is selected as the internal oscillator(osc2). therefore the initial state is a general-purpose port m. port m register 7 6 5 4 3 2 1 0 pmdata bit symbol pm1 pm0 (0x4000_0300) read/write r r/w after reset ?0? is read ?0? port m control register 7 6 5 4 3 2 1 0 pmcr bit symbol pm1c pm0c (0x4000_0304) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read output 0: disabled 1: enabled port m open drain control register 7 6 5 4 3 2 1 0 pmod bit symbol pm1od pm0od (0x4000_ 0328) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:cmos 1:open dra in
8 input/output ports tmpm380/m382 tmpm380/m382 - 28 / 52 - port m pull-up control register 7 6 5 4 3 2 1 0 pmpup bit symbol pm1up pm0up (0x4000_032c) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-up 0: disabled 1: enabled port m pull-down control register 7 6 5 4 3 2 1 0 pmpdn bit symbol pm1dn pm0dn (0x4000_0330) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-down 0:disabled 1:enabled port m input enable control register 7 6 5 4 3 2 1 0 pmie bit symbol pm1ie pm0ie (0x4000_0338) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 29 / 52 - 8.2.14 port n (pn0 to pn7) the port n is a general-purpose, 8-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-purp ose input/output function, the port n performs the serial interface function, timer input/ output and the input/output for igbt(mpt). reset initializes all bits of the port n as gener al-purpose ports with input, output, pull-up and pull-down disabled. (note) in modes other than stop mode, interrupt input is enabled regardless of the pxfr register setting as long as input is enabled in pxie. make sure to disable unused interrupts when programming the device. port n register 7 6 5 4 3 2 1 0 pndata bit symbol pn7 pn6 pn5 pn4 pn3 pn2 pn1 pn0 (0x4000_0340) read/write r/w after reset ?0? port n control register 7 6 5 4 3 2 1 0 pncr bit symbol pn7c pn6c pn5c pn4c pn3c pn2c pn1c pn0c (0x4000_0344) read/write r/w after reset 0 0 0 0 0 0 0 0 function output 0: disabled 1: enabled port n functions register 1 7 6 5 4 3 2 1 0 pnfr1 bit symbol pn7f1 pn6f1 pn5f1 pn4f1 pn3f1 pn2f1 pn1f1 pn0f1 (0x4000_0348) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:port 1:mt2in 0:port 1:emg2 0:port 1:mtout1 2 0:port 1: mtout02 0:port 1:sp1fss 0:port 1:sp1clk 0:port 1:sp1di 0:port 1: sp1do0 (important) tmpm382 (64 pin version) does not implement port n (pn0 to pn7). please do not use these functions if you use this product.
8 input/output ports tmpm380/m382 tmpm380/m382 - 30 / 52 - port n functions register 2 7 6 5 4 3 2 1 0 pnfr2 bit symbol pn7f2 pn5f2 pn4f2 (0x4000_034c) read/write r/w r r/w r/w r after reset 0 0 0 0 0 0 0 0 function 0:port 1:inte. ?0? is read. 0:port 1:mttb2i n 0:port 1:mttb2 out ?0? is read. port n open drain control register 7 6 5 4 3 2 1 0 pnod bit symbol pn7od pn6od pn5od pn4od pn3od pn2od pn1od pn0od (0x4000_ 0368) read/write r/w after reset 0 0 0 0 0 0 0 0 function 0:cmos 1:open drain port n pull-up control register 7 6 5 4 3 2 1 0 pnpup bit symbol pn7up pn6up pn5up pn4up pn3up pn2up pn1up pn0up (0x4000_036c) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-up 0:disabled 1:enabled port n pull-down control register 7 6 5 4 3 2 1 0 pnpdn bit symbol pn7dn pn6dn pn5dn pn4dn pn3dn pn2dn pn1dn pn0dn (0x4000_0370) read/write r/w after reset 0 0 0 0 0 0 0 0 function pull-down 0:disabled 1:enabled port n input enable control register 7 6 5 4 3 2 1 0 pnie bit symbol pn7ie pn6ie pn5ie pn4ie pn3ie pn2ie pn1ie pn0ie (0x4000_0378) read/write r/w after reset 0 0 0 0 0 0 0 0 function input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 31 / 52 - 8.2.15 port p (pp0 to pp1) the port p is a general-purpose, 2-bit input/out put port. for this port, inputs and outputs can be specified in units of bits. besides the general-pu rpose input/output function, the port p performs the low-speed oscillator(xt1 and xt2). (note 1) reset initializes all bits of the port p as genera l-purpose ports with input, output, pull-up, pull-down and low-speed oscillator disabled.(note 2) (note 1) the external low-spee d oscillator must not be change d while portp is high output. if you use the external low-speed oscilla tor,refer to "6.clock/mode control" (note 2) after reset,the low-speed clock is stopped. therefore the initial state is a general-purpose port p. port p register 7 6 5 4 3 2 1 0 ppdata bit symbol pp1 pp0 (0x4000_0380) read/write r r/w after reset ?0? is read ?0? port p control register 7 6 5 4 3 2 1 0 ppcr bit symbol pp1c pp0c (0x4000_0384) read/write r r/w after reset 0 0 0 function ?0? is read. output 0: disabled ??? 1: enabled port p open drain control register 7 6 5 4 3 2 1 0 ppod bit symbol pp1od pp0od (0x4000_ 03a8) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read 0:cmos 1:open drain
8 input/output ports tmpm380/m382 tmpm380/m382 - 32 / 52 - port p pull-up control register 7 6 5 4 3 2 1 0 pppup bit symbol pp1up pp0up (0x4000_03ac) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-up 0:disabled 1:enabled port p pull-down control register 7 6 5 4 3 2 1 0 pppdn bit symbol pp1dn pp0dn (0x4000_03b0) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read pull-down 0:disabled 1:enabled port p input enable control register 7 6 5 4 3 2 1 0 ppie bit symbol pp1ie pp0ie (0x4000_03b8) read/write r r/w after reset 0 0 0 function ?0? is read input 0:disabled 1:enabled
tmpm380/m382 tmpm380/m382 - 33 / 52 - 8.3 appendex (ports setting) the setting of the registers of each func tion lists are shown in the following. 8.3.1 port a setting table 8-2 port a setting port a sfr port name function type padata pacr pafrn paod papup papdn paie * gpio - 0 tb0in ft1 x 0 pa0f1 0 1 pa0 int3 ft4 x 0 pa0f2 0 1 * gpio - 0 tb0out ft1 x 1 pa1f1 0 pa1 scout ft1 x 1 pa1f2 0 * gpio - 0 tb1in ft1 x 0 pa2f1 0 1 pa2 int4 ft4 x 0 pa2f2 0 1 * gpio - 0 tb1out ft1 x 1 pa3f1 0 pa3 rxin ft1 x 0 pa3f2 0 1 * gpio - 0 sclk1 (in) ft1 x 0 pa4f1 0 1 sclk1 (out) ft1 x 1 pa4f1 0 pa4 cts1 ft1 x 0 pa4f2 0 1 * gpio - 0 tx1 ft1 x 1 pa5f1 0 pa5 tb6out ft1 x 1 pa5f2 0 * gpio - 0 rx1 ft1 x 0 pa6f1 0 1 pa6 tb6in ft1 x 0 pa6f2 0 1 * gpio - 0 tb4in ft1 x 0 pa7f1 0 1 pa7 int8 ft4 x 0 pa7f2 0 1 function * initial state intn when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the pafr2 register. pafrn "0" all the corresponding bits of the paf rn registers are not selected. "paxfn" the bits of the pafrn registers shoul d be selected are described by the bit symbol name. common setting in port a sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 34 / 52 - 8.3.2 port b setting table 8-3 port b setting port b sfr port name function type pbdata pbcr pbfrn pbod pbpup pbpdn pbie * gpio - 0 pb0 traceclk ft1 x 1 pb0f1 0 * gpio - 0 pb1 tracedata0 ft1 x 1 pb1f1 0 * gpio - 0 pb2 tracedata1 ft1 x 1 pb2f1 0 * tms/swdio ft2 x 1 pb3f1 0 1 0 1 pb3 gpio - 0 * tck/swclk ft2 x 0 pb4f1 0 0 1 1 pb4 gpio - 0 * tdo/swv ft2 x 1 pb5f1 0 0 0 0 pb5 gpio - 0 * tdi ft2 x 0 pb6f1 0 1 0 1 pb6 gpio - 0 * trst ft2 x 0 pb7f1 0 1 0 1 pb7 gpio - 0 function * initial state pbfrn "0" all the corresponding bits of the pbf r1 registers are not selected. "pbxfn" the bits of the pbfr1 registers shoul d be selected are described by the bit symbol name. common setting in port c sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 35 / 52 - 8.3.3 port c setting table 8-4 port c setting port c sfr port name function type pcdata pccr pcfrn pcod pcpup pcpdn pcie * gpio - 0 uo0 ft3 x 1 pc0f1 0 sp0do ft3 x 1 pc0f2 0 sda0 ft1 x 1 pc0f3 1 1 pc0 so0 ft1 x 1 pc0f4 0 * gpio - 0 xo0 ft3 x 1 pc1f1 0 sp0di ft1 x 0 pc1f2 0 1 scl0 ft1 x 1 pc1f3 1 1 pc1 si0 ft1 x 0 pc1f4 0 1 * gpio - 0 vo0 ft3 x 1 pc2f1 0 sp0clk (in) ft3 x 0 pc2f2 0 1 sp0clk (out) ft3 x 1 pc2f2 0 sck0 (in) ft1 x 0 pc2f3 0 1 pc2 sck0 (out) ft1 x 1 pc2f3 0 * gpio - 0 yo0 ft3 x 1 pc3f1 0 sp0fss (in) ft3 x 0 pc3f2 0 1 pc3 sp0fss (out) ft3 x 1 pc3f2 0 * gpio - 0 wo0 ft3 x 1 pc4f1 0 mtout00 ft3 x 1 pc4f2 0 pc4 mttb0out ft1 x 1 pc4f3 0 * gpio - 0 zo0 ft3 x 1 pc5f1 0 mtout10 ft3 x 1 pc5f2 0 mttb0in ft1 x 0 pc5f3 0 1 sclk4 (in) ft1 x 0 pc5f4 0 1 sclk4 (out) ft1 x 1 pc5f4 0 pc5 cts4 ft1 x 0 pc5f5 0 1 * gpio - 0 emg0 ft1 x 0 pc6f1 0 1 gemg0 ft1 x 0 pc6f2 0 1 pc6 tx4 ft1 x 1 pc6f4 0 * gpio - 0 mt0in ft1 x 0 pc7f2 0 1 pc7 rx4 ft1 x 0 pc7f4 0 1
8 input/output ports tmpm380/m382 tmpm380/m382 - 36 / 52 - function * initial state pcfrn "0" all the corresponding bits of the pc frn registers are not selected. "pcxfn" the bits of the pcfrn r egisters should be selected are described by the bit symbol name. common setting in port c sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 37 / 52 - 8.3.4 port d setting table 8-5 port d setting port d sfr port name function type pddata pdcr pdfrn pdod pdpup pdpdn pdie pd0 * gpio - 0 enca0 ft1 x 0 pd0f1 0 1 tb5in ft1 x 0 pd0f2 0 1 intc ft4 x 0 pd0f3 0 1 pd1 * gpio - 0 encb0 ft1 x 0 pd1f1 0 1 tb5out ft1 x 1 pd1f2 0 pd2 * gpio - 0 encz0 ft1 x 0 pd2f1 0 1 intd ft4 x 0 pd2f3 0 1 pd3 * gpio - 0 int9 ft4 x 0 pd3f1 0 1 pd4 * gpio - 0 sclk2 (in) ft1 x 0 pd4f1 0 1 sclk2 (out) ft1 x 1 pd4f1 0 cts2 ft1 x 0 pd4f2 0 1 pd5 * gpio - 0 tx2 ft1 x 1 pd5f1 0 pd6 * gpio - 0 rx2 ft1 x 0 pd6f1 0 1 function * initial state intn when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the pdfrn register. pdfrn "0" all the corresponding bits of the pd frn registers are not selected. "pdxfn" the bits of the pdfrn registers shoul d be selected are described by the bit symbol name. common setting in port d sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 38 / 52 - 8.3.5 port e setting table 8-6 port e setting port e sfr port name function type pedata pecr pefrn peod pepup pepdn peie * gpio - 0 pe0 tx0 ft1 x 1 pe0f1 0 * gpio - 0 pe1 rx0 ft1 x 0 pe1f1 0 1 * gpio - 0 sclk0 (in) ft1 x 0 pe2f1 0 1 sclk0 (out) ft1 x 1 pe2f1 0 pe2 cts0 ft1 x 0 pe2f2 0 1 * gpio - 0 pe3 tb4out ft1 x 1 pe3f1 0 * gpio - 0 tb2in ft1 x 0 pe4f1 0 1 pe4 int5 ft4 x 0 pe4f2 0 1 * gpio - 0 pe5 tb2out ft1 x 1 pe5f1 0 * gpio - 0 tb3in ft1 x 0 pe6f1 0 1 pe6 int6 ft4 x 0 pe6f2 0 1 * gpio - 0 tb3out ft1 x 1 pe7f1 0 pe7 int7 ft4 x 0 pe7f2 0 1 function * initial state intn when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the pefr2 register. pefrn "0" all the corresponding bits of the pef rn registers are not selected. "pexfn" the bits of the pefrn registers should be selected are described by the bit symbol name. common setting in port e sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 39 / 52 - 8.3.6 port f setting table 8-7 port f setting port f sfr port name function type pfdata pfcr pffrn pfod pfpup pfpdn pfie * gpio - 0 pf0 tb7in ft1 x 0 pf0f1 0 1 * gpio - 0 tb7out ft1 x 1 pf1f1 0 pf1 alarm ft1 x 1 pf1f2 0 * gpio - 0 enca1 ft1 x 0 pf2f1 0 1 sclk3 (in) ft1 x 0 pf2f2 0 1 sclk3 (out) ft1 x 1 pf2f2 0 pf2 cts3 ft1 x 0 pf2f3 0 1 * gpio - 0 encb1 ft1 x 0 pf3f1 0 1 pf3 tx3 ft1 x 1 pf3f2 0 * gpio - 0 encz1 ft1 x 0 pf4f1 0 1 pf4 rx3 ft1 x 0 pf4f2 0 1 function * initial state pffrn "0" all the corresponding bits of the p ffrn registers are not selected. "pfxfn" the bits of the pffrn registers should be selected are described by the bit symbol name. common setting in port f sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 40 / 52 - 8.3.7 port g setting table 8-8 port g setting port g sfr port name function type pgdata pgcr pgfrn pgod pgpup pgpdn pgie * gpio - 0 uo1 ft3 x 1 pg0f1 0 sda1 ft1 x 1 pg0f3 1 1 pg0 so1 ft1 x 1 pg0f4 0 * gpio - 0 xo1 ft3 x 1 pg1f1 0 scl1 ft1 x 1 pg1f3 1 1 pg1 si1 ft1 x 0 pg1f4 0 1 * gpio - 0 vo1 ft3 x 1 pg2f1 0 sck1 (in) ft1 x 0 pg2f3 0 1 pg2 sck1 (out) ft1 x 1 pg2f4 0 * gpio - 0 pg3 yo1 ft3 x 1 pg3f1 0 * gpio - 0 wo1 ft3 x 1 pg4f1 0 mtout01 ft3 x 1 pg4f2 0 pg4 mttb1out ft1 x 1 pg4f3 0 * gpio - 0 zo1 ft3 x 1 pg5f1 0 mtout11 ft3 x 1 pg5f2 0 pg5 mttb1in ft1 x 0 pg5f3 0 1 * gpio - 0 emg1 ft1 x 0 pg6f1 0 1 pg6 gemg1 ft1 x 0 pg6f2 0 1 * gpio - 0 pg7 mt1in ft1 x 0 pg7f2 0 1 function * initial state pgfrn "0" all the corresponding bits of the pg frn registers are not selected. "pgxfn" the bits of the pgfrn registers should be selected are described by the bit symbol name. common setting in port g sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 41 / 52 - 8.3.8 port h setting table 8-9 port h setting port h sfr port name function type phdata phcr phfrn phod phpup phpdn phie * gpio - 0 int0 ft4 x 0 ph0f1 0 1 ph0 ain0 ft5 x 0 0 0 0 0 0 * gpio - 0 int1 ft4 x 0 ph1f1 0 1 ph1 ain1 ft5 x 0 0 0 0 0 0 * gpio - 0 int2 ft4 x 0 ph2f1 0 1 ph2 ain2 ft5 x 0 0 0 0 0 0 * gpio - - ph3 ain3 ft5 x 0 - 0 0 0 0 * gpio - - ph4 ain4 ft5 x 0 - 0 0 0 0 * gpio - - ph5 ain5 ft5 x 0 - 0 0 0 0 * gpio - - ph6 ain6 ft5 x 0 - 0 0 0 0 * gpio - - ph7 ain7 ft5 x 0 - 0 0 0 0 function * initial state intn when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the phfr1 register. phfr1 "0" all the corresponding bits of the ph fr1 registers are not selected. "phxf1" the bits of the phfr1 registers should be selected are described by the bit symbol name. - there is no corresponding bit. common setting in port h sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 42 / 52 - 8.3.9 port i setting table 8-10 port i setting port i sfr port name function type pidata picr pifrn piod pipup pipdn piie * gpio - - pi0 ain8 ft5 x 0 - 0 0 0 0 * gpio - - pi1 ain9 ft5 x 0 - 0 0 0 0 function * initial state pifr1 "0" all the corresponding bits of the pi fr1 registers are not selected. "pixf1" the bits of the pifr1 registers shoul d be selected are described by the bit symbol name. - there is no corresponding bit. common setting in port i sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0") - there is no corresponding bit.
tmpm380/m382 tmpm380/m382 - 43 / 52 - 8.3.10 port j setting table 8-11 port j setting port j sfr port name function type pjdata pjcr pjfrn pjod pjpup pjpdn pjie * gpio - - pj0 ain10 ft5 x 0 - 0 0 0 0 * gpio - - pj1 ain11 ft5 x 0 - 0 0 0 0 * gpio - - pj2 ain12 ft5 x 0 - 0 0 0 0 * gpio - - pj3 ain13 ft5 x 0 - 0 0 0 0 * gpio - - pj4 ain14 ft5 x 0 - 0 0 0 0 * gpio - - pj5 ain15 ft5 x 0 - 0 0 0 0 * gpio - 0 inta ft4 x 0 pj6f1 0 1 pj6 ain16 ft5 x 0 0 0 0 0 0 * gpio - 0 intb ft4 x 0 pj7f1 0 1 pj7 ain17 ft5 x 0 0 0 0 0 0 function * initial state intn when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the pjfr1 register. pjfr1 "0" all the corresponding bits of the pj fr1 registers are not selected. "pjxf1" the bits of the pjfr1 registers should be selected are described by the bit symbol name. - there is no corresponding bit. common setting in port j sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 44 / 52 - 8.3.11 port l setting table 8-12 port l setting port l sfr port name function type pldata plcr plfrn plod plpup plpdn plie * gpio - - pl0 boot ft6 x x - x x x x * gpio - 0 pl2 intf ft4 x 0 pl2f1 0 1 function * initial state the function that becomes effective for reset. intf when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the plfr1 register. plfr1 "0" all the corresponding bits of the pl fr1 registers are not selected. "pl2f1" the bits of the plfr1 registers should be selected are described by the bit symbol name. - there is no corresponding bit. common setting in port l sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0") 8.3.12 port m setting table 8-13 port m setting port m sfr port name function type pmdata pmcr pmfrn pmod pmpup pmpdn pmie * gpio - - pm0 x1 ft5 x 0 - 0 0 0 0 * gpio - - pm1 x2 ft5 x 0 - 0 0 0 0 function * initial state pmfr1 - there is no corresponding bit. common setting in port m sfr "0" the corresponding bit is set to ?0?. ? arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 45 / 52 - 8.3.13 port n setting table 8-14 port n setting port n sfr port name function type pndata pncr pnfrn pnod pnpup pnpdn pnie * gpio - 0 pn0 sp1do ft3 x 1 pn0f1 0 * gpio - 0 pn1 sp1di ft1 x 0 pn1f1 0 1 * gpio - 0 sp1clk (in) ft3 x 0 pn2f1 0 1 pn2 sp1clk (out) ft3 x 1 pn2f1 0 * gpio - 0 sp1fss (in) ft3 x 0 pn3f1 0 1 pn3 sp1fss (out) ft3 x 1 pn3f1 0 * gpio - 0 mtout02 ft3 x 1 pn4f1 0 pn4 mttb2out ft1 x 1 pn4f2 0 * gpio - 0 mtout12 ft3 x 1 pn5f1 0 pn5 mttb2in ft1 x 0 pn5f2 0 1 * gpio - 0 pn6 gemg2 ft1 x 0 pn6f1 0 1 * gpio - 0 mt2in ft1 x 0 pn7f1 0 1 pn7 inte ft4 x 0 pn7f2 0 1 function * initial state inte when the external interrupt input for releasing stop mode is not used, it is not necessary to care for the pnfr2 register. pnfrn "0" all the corresponding bits of the pn frn registers are not selected. "pnxfn" the bits of the pnfrn registers should be selected are described by the bit symbol name. common setting in port n sfr "0" the corresponding bit is set to ?0?. "1" the corresponding bit is set to ?1?.  arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
8 input/output ports tmpm380/m382 tmpm380/m382 - 46 / 52 - 8.3.14 port p setting table 8-15 port p setting port p sfr port name function type ppdata ppcr ppfrn ppod pppup pppdn ppie * gpio - - pp0 xt1 ft5 x 0 - 0 0 0 0 * gpio - - pp1 xt2 ft5 x 0 - 0 0 0 0 function * initial state ppfrn - there is no corresponding bit. port p sfr ? "0" the corresponding bit is set to ?0?. arbitrarily it sets and it uses it acco rding to the purpose. (after reset "0") x don't care (after reset "0")
tmpm380/m382 tmpm380/m382 - 47 / 52 - 8.4 port section equivale nt circuit schematics the setting of the registers of each function list is shown in the following. 8.4.1 port type ft1 sclkn/sckn/scln/sdan tbnin/rxn/ctsn/sin/spndi/rxin/emgn ----------------- /gemgn --------------------- /mtnin/mttbnin/encan/ encbn/ enczn tbnout/txn/son/scout/alarm -------------------- /mttbnout/traceclk/tracedatan ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) pxie (input control) drive disable in stop mode function output port read 1 0 0 1 pxod (open drain control) pxfr (function control) pxpdn (pull-down control) -on reset(ub) i/o port function input reset ? ? figure 8-1 port type ft1 ?
8 input/output ports tmpm380/m382 tmpm380/m382 - 48 / 52 - 8.4.2 port type ft2 tms/swdio tck/swclk/tdi/trst --------------- tdo/swv+pio ? ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) pxie (input control) drive disable in stop mode function output port read 1 0 0 1 pxod (open drain control) pxfr (function control) pxpdn (pull-down control) -on reset(ub) i/o port function output enable function input 1 0 ? ? figure 8-2 port type ft2 ? ?
tmpm380/m382 tmpm380/m382 - 49 / 52 - 8.4.3 port type ft3 spnclk/spnfss spndo/uon/von/won/y on/zon/mtout0n/mtout1n ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) pxie (input control) drive disable in stop mode function output port read 1 0 0 1 pxod (open drain control) pxfr (function control) pxpdn (pull-down control) i/o port function output enable function input 1 0 -on reset(ub) reset ? ? ? figure 8-3 port type ft3 ? ?
8 input/output ports tmpm380/m382 tmpm380/m382 - 50 / 52 - 8.4.4 port type ft4 intn ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) pxie (input control) drive disable in stop mode port read 0 1 pxod (open drain control) pxfr (function control) pxpdn (pull-down control) -on reset(ub) i/o port reset ? noise filter (30ns typ) interrupt input ? ? figure 8-4 port type ft4 ? ?
tmpm380/m382 tmpm380/m382 - 51 / 52 - 8.4.5 port type ft5 ainn/xn/xtn ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) pxie (input control) drive disable in stop mode port read 0 1 pxod (open drain control) pxpdn (pull-down control) -on reset(ub) i/o port reset ? ainn, xn, xtn ? ? figure 8-5 port type ft5 ? ?
8 input/output ports tmpm380/m382 tmpm380/m382 - 52 / 52 - 8.4.6 port type ft6 boot ---------------- ? internal data bus pxpup (pull-up control) pxcr (output control) pxdata (output latch) drive disable in stop mode pxod (open drain control) pxpdn (pull-down control) -on reset(ub) i/o port reset ? boot ? ? figure 8-6 port type ft6 ? ? ? ? ?
tmpm380/m382 tmpm380/m382 - 1 / 34 - 9 16-bit timer/event counters (tmrbs) 9.1 outline tmpm380 have the eight channels multi-functional 16-bit timer/event counter. (tmrb0 through tmrb7) tmrbs operate in the following five operation modes: ? 16-bit interval timer mode ? 16-bit event counter mode ? 16-bit programmable square-wave output mode (ppg) ? external trigger programmable square-wave output mode (ppg) ? timer synchronous mode (capable of setting output mode for each 4ch) the use of the capture function allows tmrb s to perform the following three measurements ? one-shot pulse generation from an external trigger pulse ? frequency measurement ? pulse width measurement important neither tb3in,tb3out,tb5in nor tb5out are allocated in tmpm382 (64-pin version). please do not use the function (up-counter source clock selection and capture operation that uses terminal tb3in / tb 5in, timer flip-flop output t hat uses terminal tb3out / tb5out.) to use a pertinent terminal. however, tmrb3 and tmrb5 can be used by select ing a built-in clock as 16 bit interval timer.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 2 / 34 - ? 9.2 specification differences among channels channels (tmrb0 through tmrb7) operate independently and the functions are same except the differences as shown in table 9-1 to table 9-3. therefore, the ope rational descri ption s here are explained only for tmrb0. the channels shown below are used as the capture or start trigger. (1) the flip-flop output of tmrb 2, tmrb 5 and tm rb 7 can be used as the capture trigger of other channels. ? ? tb2out => available for tmrb 3 through tmrb 5 ? ? tb5out => available for tmrb 6 through tmrb 7 ? ? tb7out => available for tmrb 0 through tmrb 2 (2) the start trigger of the timer synchronous mode (with tbprun,tbrun) ? ? tmrb0 => can st a rt with tmrb 1 through tmrb 3 synchronously ? ? tmrb4 => can start with tmrb 5 through tmrb 7 synchronously table 9-1 differences in the specifications of tmrb modules (1) for tmpm380 table 9-2 differences in the specifications of tmrb modules (2) for tmpm382 external pins trigger specification channel external clock/ capture trigger input pins timer flip-flop output pin timer for capture triggers timer for synchronous start triggers tmrb0 tb0in tb0out tb7out - tmrb1 tb1in tb1out tb7out tb0prun,tb0run tmrb2 tb2in tb2out tb7out tb0prun,tb0run tmrb3 tb3in tb3out tb2out tb0prun,tb0run tmrb4 tb4in tb4out tb2out - tmrb5 tb5in tb5out tb2out tb4prun,tb4run tmrb6 tb6in tb6out tb5out tb4prun,tb4run tmrb7 tb7in tb7out tb5out tb4prun,tb4run external pins trigger specification channel external clock/ capture trigger input pins timer flip-flop output pin timer for capture triggers timer for synchronous start triggers tmrb0 tb0in tb0out tb7out - tmrb1 tb1in tb1out tb7out tb0prun,tb0run tmrb2 tb2in tb2out tb7out tb0prun,tb0run tmrb3 tb2out tb0prun,tb0run tmrb4 tb4in tb4out tb2out - tmrb5 tb2out tb4prun,tb4run tmrb6 tb6in tb6out tb5out tb4prun,tb4run tmrb7 tb7in tb7out tb5out tb4prun,tb4run
tmpm380/m382 tmpm380/m382 - 3 / 34 - table 9-3 differences in the specifications of tmrb modules (3) interrupt specification channel capture interrupt tmrb interrupt tmrb0 intcap00 intcap01 inttb00 inttb01 tmrb1 intcap10 intcap11 inttb10 inttb11 tmrb2 intcap20 intcap21 inttb20 inttb21 tmrb3 intcap30 intcap31 inttb30 inttb31 tmrb4 intcap40 intcap41 inttb40 inttb41 tmrb5 intcap50 intcap51 inttb50 inttb51 tmrb6 intcap60 intcap61 inttb60 inttb61 tmrb7 intcap70 intcap71 inttb70 inttb71
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 4 / 34 - ? 9.3 configuration each channel consists of a 16-bit up-counter , two 16-bit timer regi sters (one of which is double-buffered), two 16-bit capture registers, two comparators, a capture input control, a timer flip-flop and its associated control circuit. timer operation modes and the timer f lip-flop are controlled by registers. fig 9-1 tmrb0 block diagram (the same applies to channels 1 through 7) for tmpm380, tmrb0 block diagram (the same applies to channels 0,1,2,4,6,7) for tmpm382
tmpm380/m382 tmpm380/m382 - 5 / 34 - fig 9-2 tmrb3 block diagram (the same applies to channel 5) for tmpm382 because the tmrb3 and the tmrb5 of tmpm 382 (64 pins) have no external input pins (tbxin), the tb2out is the only capture trigge r signal. the timer flip-flop output cannot be used as an external output, because it is not assigned to an external output. however, the tb5out can be used as a capture trigger signal for the tmrb6 and the tmrb7.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 6 / 34 - 9.4 registers 9.4.1 tmrb registers table 9-4 shows the register names and addresses of each channel. table 9-4 tmrb registers channel specification tmrb0 tmrb1 tmrb2 tmrb3 timer enable register tb0en 0x4001_0000 tb1en 0x4001_0040 tb2en 0x4001_0080 tb3en 0x4001_00c0 timer run register tb0run 0x4001_0004 tb1run 0x4001_0044 tb2run 0x4001_0084 tb3run 0x4001_00c4 timer control register tb0cr 0x4001_0008 tb1cr 0x4001_0048 tb2cr 0x4001_0088 tb3cr 0x4001_00c8 timer mode register tb0mod 0x4001_000c tb1mod 0x4001_004c tb 2mod 0x4001_008c tb3mod 0x4001_00cc timer flip-flop control register tb0ffcr 0x4001_0010 tb1ffcr 0x4001_0050 tb2ffcr 0x4001_0090 tb3ffcr 0x4001_00d0 timer status register tb0st 0x4001_0014 tb1st 0x4001_0054 tb2st 0x4001_0094 tb3st 0x4001_00d4 interrupt mask register tb0im 0x 4001_0018 tb1im 0x4001_0058 tb2im 0x4001_0098 tb3im 0x4001_00d8 timer up counter register tb0uc 0x4001_001c tb1uc 0x4001_005c tb2uc 0x4001_009c tb3uc 0x4001_00dc timer register tb0rg0 tb0rg1 0x4001_0020 0x4001_0024 tb1rg0 tb1rg1 0x4001_0060 0x4001_0064 tb2rg0 tb2rg1 0x4001_00a0 0x4001_00a4 tb3rg0 tb3rg1 0x4001_00e0 0x4001_00e4 register names (addresses) capture register tb0cp0 tb0cp1 0x4001_0028 0x4001_002c tb1cp0 tb1cp1 0x4001_0068 0x4001_006c tb2cp0 tb2cp1 0x4001_00a8 0x4001_00ac tb3cp0 tb3cp1 0x4001_00e8 0x4001_00ec channel specification tmrb4 tmrb5 tmrb6 tmrb7 timer enable register tb4en 0x4001_0100 tb5en 0x4001_0140 tb6en 0x4001_0180 tb7en 0x4001_01c0 timer run register tb4run 0x4001_0104 tb5run 0x4001_0144 tb6run 0x4001_0184 tb7run 0x4001_01c4 timer control register tb4cr 0x4001_0108 tb5cr 0x4001_0148 tb6cr 0x4001_0188 tb7cr 0x4001_01c8 timer mode register tb4mod 0x4001_010c tb5mod 0x4001_014c tb 6mod 0x4001_018c tb7mod 0x4001_01cc timer flip-flop control register tb4ffcr 0x4001_0110 tb5ffcr 0x4001_0150 tb6ffcr 0x4001_0190 tb7ffcr 0x4001_01d0 timer status register tb4st 0x4001_0114 tb5st 0x4001_0154 tb6st 0x4001_0194 tb7st 0x4001_01d4 interrupt mask register tb4im 0x 4001_0118 tb5im 0x4001_0158 tb6im 0x4001_0198 tb7im 0x4001_01d8 timer up counter register tb4uc 0x4001_011c tb5uc 0x4001_015c tb6uc 0x4001_019c tb7uc 0x4001_01dc timer register tb4rg0 tb4rg1 0x4001_0120 0x4001_0124 tb5rg0 tb5rg1 0x4001_0160 0x4001_0164 tb6rg0 tb6rg1 0x4001_01a0 0x4001_01a4 tb7rg0 tb7rg1 0x4001_01e0 0x4001_01e4 register names (addresses) capture register tb4cp0 tb4cp1 0x4001_0128 0x4001_012c tb5cp0 tb5cp1 0x4001_0168 0x4001_016c tb6cp0 tb6cp1 0x4001_01a8 0x4001_01ac tb7cp0 tb7cp1 0x4001_01e8 0x4001_01ec tb3ffcr is only for tmpm380.
tmpm380/m382 tmpm380/m382 - 7 / 34 - 9.4.1.1 tmrbn enable register (channels 0 through 7) tmrbn enable regi ster (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tben tbhalt read/write r/w r/w r after reset 0 0 0 function tmrbn operation 0: disabled 1: enabled control in halt ? mode at debug 0: disabled 1: enabled ?0? is read. tben : specifies the tmrbn operation. when the operation is disabled, no clock is supplied to the other registers in the tmrbn module. this can reduce power consumption. (this disables reading from and writing to the other registers.) to use the tmrbn, enable the tmrbn operation (s et to ?1?) before programming each register in the tmrbn module. after the tmrbn operation is executed and then disabled, the settings will be maintained in each registers. tbhalt : specifies the control in halt mode during debug mode. 0: clock not stops in halt mode 1: clock stops in halt mode tbnen (0x4001_0xx0)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 8 / 34 - 9.4.1.2 tmrb run register (channels 0 through 7) tmrbn run register (n=0 ~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tbprun tbrun read/write r r/w r r/w after reset 0 0 0 0 function ?0? is read. timer run/stop control 0: stop & clear 1: count * the bit 1 can be read as ?0.? tbrun :controls the tmrbn count operation. 0: stop counting and the counter is cleared to ?0?. 1: start counter tbprun :controls the tmrbn prescaler operation. 0: stop prescaler operation and the prescaler is cleared to ?0?. 1: start prescaler operation. tbnrun (0x4001_0xx4)
tmpm380/m382 tmpm380/m382 - 9 / 34 - 9.4.1.3 tmrb control register (channels 0 through 7) tmrbn control register (n =0~7) 31 30 29 28 27 26 25 24 b i t s y m b o l read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tbwbf tbsync i2tb trgsel cssel read/write r/w r/w r/w r r/w r r/w r/w after reset 0 0 0 0 0 0 0 0 function double buffer 0: disabled 1: enabled write ?0?. sync. mode select 0:asyunc. 1:syunc. ?0? is read. during idle mode 0:stop 1:operation ?0? is read. external trigger 0: rising edge 1: falling edge counter start 0: software start 1: external trigger : selects how the timer starts counting. 0: select software for timer count start. 1: select external trigger for timer count start. : selects the active edge of the external trigger signal. 0: select rising edge of external trigger. 1: select falling edge of external trigger. i2tb :controls the clock keep/ stop operation during the idle mode. 0: stop the clock. 1: keep clock operation during idle mode. tbncr (0x4001_0xx8) write ?0? in case of using tmrb3 and tmrb5 of tmpm382. write "0" in case of using tmrb3 and tmrb5 of tmpm382.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 10 / 34 - tbwbf :controls the enabling/disabling of double buffering. 0: disable double buffer. 1: enable double buffer. (note) tbncr resister must not be changed during timer operation (tbnrun=1)
tmpm380/m382 tmpm380/m382 - 11 / 34 - 9.4.1.4 tmrb mode register (channels 0 thorough 7) tmrbn mod e regi ster(n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tbrswr tbcp tbcpm1 tbcpm0 tbcle tbclk1 tbclk0 read/write r r/w w r/w after reset 0 0 1 0 0 0 0 0 function ?0? is read. writes to timer registers 0 and 1 (when double buffering is enabled) 0: can be written separately 1: must be written simultaneo usly software capture control 0: software capture 1: don't care capture timing 00: disable 01: tbnin 10: tbnin tbnin 11: tbnout tbnout up-counter clear control 0:clear and disable 1:clear and enable source clock 00: tbnin pin input 01: t1 10: t4 11: t16 tbclk1:0 :selects the tmrbn timer count clock. 00: select tbnin input pin 01: select t1 (1/2 t0) 10: select t4 (1/8 t0) 11: select t16 (1/32 t0) tbcle :clears and controls the tmrbn up-counter. ?0?: disables clearing of the up-counter. ?1?: clears up-counter if there is a match with timer register 1 (tbnrg1). tbnmod (0x4001_0xxc) "00" is disable in case of using tmrb3 and tmrb5 of tmpm382.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 12 / 34 - tbcpm1:0 :specifies tmrbn capture timing. ?00?: capture disable ?01?: takes count values into capture r egister 0 (tbncp0) upon rising of tbnin pin input. ?10?: takes count values into capture r egister 0 (tbncp0) upon rising of tbnin pin input and into capture register 1 (t bncp1) upon falling of tbnin pin input. ?11?: takes count values into capture regi ster 0 (tbncp0) upon rising of 16-bit timer match output (tbnout) and into capture regi ster 1 (tbncp1) upon falling of tbnout. (tmrb3 through tmrb5:tb2out, tmrb6 and tmrb7:tb5out, tmrb0 through and tmrb2:tb7out). tbcp :captures count values by software and take s them into capture register 0 (tbncp0). : controls the timing to write to timer registers 0 and 1 when double buffering is enabled. ?0?: timer registers 0 and 1 can be written se parately, even in case writing preparation is ready for only one resister. ?1?: in case both resisters are not ready to be written, timer registers 0 and 1 can not be written (note 1) the value read from bit 5 of tbnmod is ?1?. (note 2) tbnmod register must not be chan ged during timer operation (tbnrun =?1?). "01" and ?10? are disable in case of using tmrb3 and tmrb5 of tmpm382.
tmpm380/m382 tmpm380/m382 - 13 / 34 - 9.4.1.5 tmrb flip-flop control register (channels 0 through 7) tmrbn flip-fl op control reg ister (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tbc1t1 tbc0t1 tbe1t1 tbe0t1 tbff0c1 tbff0c0 read/write r r/w r/w after reset 1 1 0 0 0 0 1 1 tbnff0 reverse trigger 0: disable 1: enable function ?11? is read. when the up-counter value is taken into tbncp1 when the up-counter value is taken into tbncp0 when the up-counter matches tbnrg1 when the up-counter matches tbnrg0 tbnff0 control 00: invert 01: set 10: clear 11: don't care * these are always read as ?11.? tbff0c1:0 :controls the timer flip-flop. 00 : reverses the value of tbnff0 01 : sets tbnff0 to ?1?. 10 : clears tbnff0 to ?0?. 11 :don?t care tbe0t1 :reverses the timer flip-flop when the up-count er matches the timer register 0 (tbnrg0). 0: tbnff0 not reverse 1: tbnff0 reverse tbe1t1 :reverses the timer flip-flop when the up-count er matches the timer register 1 (tbnrg1). 0: tbnff0 not reverse 1: tbnff0 reverse tbc0t1 :reverses the timer flip-flop when the up-counter value is taken into the capture register 0 (tbncp0). 0: tbnff0 not reverse 1: tbnff0 reverse tbnffcr (0x4001_0xx0)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 14 / 34 - tbc1t1 :reverses the timer flip-flop when the up-counter value is taken into the capture register 1 (tbncp1). 0: tbnff0 not reverse 1: tbnff0 reverse (note) tbnffcr register must not be changed during timer operation (tbnrun =?1?) tb3ffcr is only for tmpm380.
tmpm380/m382 tmpm380/m382 - 15 / 34 - 9.4.1.6 tmrb status register (channels 0 through 7) tmrbn st atu s register (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol inttbof inttb1 inttb0 read/write r r after reset 0 0 0 0 function ?0? is read. interrupt for overflow 0: interrupt not generated 1: interrupt generated interrupt for match with tbnreg1 0: interrupt not generated 1: interrupt generated interrupt for match with tbnreg0 0: interrupt not generated 1: interrupt generated inttb0 :interrupt generated status for a match with timer register 0 (tbnrg0) 0: no interrupt generated 1: interrupt generated inttb1 :interrupt generated status for a match with timer register 1 (tbnrg1) 0: no interrupt generated 1: interrupt generated inttbof :interrupt generated status for an up-counter overflow occurs 0: no interrupt generated 1: interrupt generated (note) if any interrupt is generated, the flag that corresponds to the interrupt is set to tbnst and the generation of interrupt is notified to the cpu. the flag is cleared by reading the tbnst register. tbnst (0x4001_0xx4)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 16 / 34 - 9.4.1.7 tmrb interrupt mask register (channels 0 through 7) tmrbn interrupt mask regi ster (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol tbimof tbim1 tbim0 read/write r r/w after reset 0 0 0 0 function ?0? is read interrupt mask for overflow 0:no interrupt mask 1: interrupt is masked interrupt mask for match with tbnreg1 0:no interrupt mask 1: interrupt is masked interrupt mask for match with tbnreg0 0:no interrupt mask 1: interrupt is masked tbim0 : interrupt mask for a match with timer register 0 (tbnrg0) 0: no interrupt mask 1: interrupt is masked tbim1 :interrupt mask for a match with timer register 1 (tbnrg1). 0: no interrupt mask 1: interrupt is masked tbimof :interrupt mask for an up counter overflow. 0: no interrupt mask 1: interrupt is masked (note) even in case tbnim set interrupt mask, tbnst status register have a interrupt requested status. tbnim (0x4001_0xx8)
tmpm380/m382 tmpm380/m382 - 17 / 34 - 9.4.1.8 tmrb read capture register (channels 0 throu gh 7) tbnuc read capture register (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol tbuc15 tbuc14 tbuc13 t buc12 tbuc11 tbuc10 tbuc9 tbuc8 read/write r after reset 0 function data obtained by read capture: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol tbuc7 tbuc6 tbuc5 tbuc4 tbuc3 tbuc2 tbuc1 tbuc0 read/write r after reset 0 function data obtained by read capture: 7-0 bit captured up-counter value. tbnuc (0x4001_0xxc)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 18 / 34 - 9.4.1.9 tmrb timer register (channels 0 through 7) tbnrg0 timer regi ster (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol tbrg015 tb rg014 tbrg013 tbrg012 tbrg 011 tbrg010 tbrg09 tbrg08 read/write r/w after reset 0 function timer count value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol tbrg07 tb rg06 tbrg05 tbg04 tbrg 03 tbrg02 tbrg01 tbrg00 read/write r/w after reset 0 function timer count value: 7-0 bit data 16bit compare value0 with up- counter tbnrg1 timer register (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol tbrg115 tb rg114 tbrg113 tbrg112 tbrg 111 tbrg110 tbrg19 tbrg18 read/write r/w after reset 0 function timer count value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol tbrg17 tb rg16 tbrg15 tbrg14 tbrg 13 tbrg12 tbrg11 tbrg10 read/write r/w after reset 0 function timer count value: 7-0 bit data 16bit compare value1 with up- counter tbnrg0 (0x4001_0xx0) tbnrg1 (0x4001_0xx4)
tmpm380/m382 tmpm380/m382 - 19 / 34 - 9.4.1.10 tmrb capture register (channels 0 through 7) tbncp0capture register (n=0~9) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol tbcp015 tbcp014 tbcp013 tbcp012 tbcp011 tbcp010 tbcp09 tbcp08 read/write r after reset 0 function timer capture value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol tbcp07 tbcp06 tbcp05 tbcp04 tbcp03 tbcp02 tbcp01 tbcp00 read/write r after reset 0 function timer capture value: 7-0 bit data : 16bit up-counter capture value0 tbncp1 capture register (n=0~7) 31 30 29 28 27 26 25 24 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol tbcp115 tbcp114 tbcp113 tbcp112 tbcp111 tbcp110 tbcp19 tbcp18 read/write r after reset 0 function timer capture value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol tbcp17 tbcp16 tbcp15 tbcp14 tbcp13 tbcp12 tbcp11 tbcp10 read/write r after reset 0 function timer capture value: 7-0 bit data : 16bit up-counter capture value1 tbncp0 (0x4001_0xx8) tbncp1 (0x4001_0xxc)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 20 / 34 - ? 9.5 description of operations for each circuit the channels operate in the same way, except for the differences in their specifications as shown in table 9-1 to table 9-3. therefore, the operational de scriptions here are o nly for channel 0. 9.5.1 prescaler there is a 4-bit prescaler to generate the source clock for up-counter uc0. the prescaler input clock t0 is fperiph, fperiph/2, fperiph/4, fper iph/8, fperiph/16 or fperiph/32 selected by cgsyscr in the cg. the peripheral clock, fperiph, is either fgear, a clock selected by cgsyscr in the cg, or fc , which is a clock before it is divided by the clock gear. the operation or the stop of a prescaler is set with tb0run where writing ?1? starts counting and writing ?0? clears and stops counting. table 9-5 show prescaler output clock re solut i ons.
tmpm380/m382 tmpm380/m382 - 21 / 34 - table 9-5 prescaler output clock resolutions @fc = 40mhz prescaler output clock resolution clear peripheral clock clock gear value prescaler clock selection t1 t4 t16 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 001(fperiph/2) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 010(fperiph/4) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 011(fperiph/8) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 100(fperiph/16) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fc/2) 101(fperiph/32) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 101(fc/4) 101(fperiph/32) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 001(fperiph/2) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 010(fperiph/4) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 011(fperiph/8) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 100(fperiph/16) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 0 (fgear) 110(fc/8) 101(fperiph/32) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 100(fc/2) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 101(fc/4) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 1 (fc) 110(fc/8) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s)
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 22 / 34 - (note 1) the prescaler output clock tn must be selected as tn tmpm380/m382 tmpm380/m382 - 23 / 34 - ? 9.5.2 up-counter (uc0) uc0 is a 16-bit binary counter. ? source clock uc0 source clock, specified by tb0mod , can be selected from either three types t1, t4 and t16 of prescaler output clock or t he external clock of the tb0in pin. ? count start/ stop counter operation is specified by tb0run. uc0 starts counting if = ?1?, and stops counting and clears counter value if = ?0?. ? timing to clear uc0 1) when a compare match is detected by setting tb0mod = ?1?, uc0 is cl eared in case the comparator detects a match between counter value and the value set in tb0rg1. uc0 operates as a free-running counter if tb0mod = ?0?. 2) when uc0 stops uc0 stops counting and cl ears counter value if tb0run = ?0?. ? uc0 overflow if uc0 overflow occurs, the inttb00 overflow interrupt is generated.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 24 / 34 - ? 9.5.3 timer registers (tb0rg0, tb0rg1) tb0rg0 and tb0rg1 are registers for setting values to compare with up-counter values and two registers are built into each channel. if the comparator detects a match between a value set in this timer register and that in a uc0 up -counter, it outputs the match detection signal. ? configuration tb0rg0 and tb0rg1 of this timer regist ers are paired with register buffer - the double-buffered configuration. the two registers use tb0c r to control the enabling/disabling of double buffering. if = ?0?, double buffering is disabled and if = ?1?, it is enabled. if double buffering is enabled, data is transferred from register buffer to the tb0rg0 and tb0rg1 timer registers when there is a match between uc0 and tb0rg1. ? default setting the values of tb0rg0 and tb0rg1 become undefined after a reset. a reset disables the double buffer. ? register setting 1) when not using double-buffering to write data to the timer registers, either a 2-byte data transfer instruction or a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by high-order 8 bits can be used. 2) when using double-buffering tb0rg0/ tb0rg1 and the register buffer0/ register buffer1 are assigned to the same address. if = ?0,? the same value is written to tb0rg0, tb0rg1 and each register buffer; if = ?1,? the value is only written to each register buffer. therefore, in order to write an initial value to the timer register, the register buffers must be set to ?disable?. then set = ?1?and write the following data to the register. note: the value of tb0rg0/1 must be set as tb0rg0 < tb0rg1 in ppg mode. ? interrupt inttb00 is generated by up0 count value matching with tb0rg0 value. inttb01 is generated by up0 count value matching with tb0rg1 value. 9.5.4 capture control this is a circuit that controls the timing to latch uc0 up-counter values into the tb0cp0 and tb0cp1 capture registers. the timing to latc h data is specified by tb0mod . software can also be used to capture val ues from the uc0 up-count er into the capture register; specifically, uc0 values are taken into the tb0cp0 capture register each time ?0? is written to tb0mod. to use this capability, the prescaler must be running (tb0run = ?1?).
tmpm380/m382 tmpm380/m382 - 25 / 34 - ? 9.5.5 capture registers (tb0cp0, tb0cp1) these are 16-bit registers for latching values fr om the uc0 up-counter. to read data from the capture register, use a 16-bit data transfer instru ction or read in the order of low-order bits followed by high-order bits. 9.5.6 up-counter capture register (tb0uc) other than th e capturing functions shown a bove, the current count val ue of the uc0 can be captured by reading the tb0u c registers. 9.5.7 comparators (cp0,cp1) these are 16-bit comparators for detecting a match by comparing set values of the uc0 up-counter with set values of the tb0rg0 and tb 0rg1 timer registers. if a match is detected, inttb00 and inttb01 are generated. 9.5.8 timer flip-flop (tb0ff0) the timer flip-flop (tb0ff0) is reversed by a match signal from the comparator and a latch signal to the capture registers. it can be enabled or disabled to reverse by setting the tb0ffcr. the value of tb0ff0 becomes undefined after a reset. the flip-flop can be reversed by writing ?00? to tb0ffcr. it can be set to ?1? by writing ?01,? and can be cleared to ?0? by writing ?10.? the tb0ff0 value can be output to the timer output pin:tb0out (shared with pa0). to enable timer output, the port a related registers pacr and pafr1 must be programmed beforehand. 9.5.9 capture interrupt (intcap00, intcap01) interrupts intcap00 and intcap01 can be generated at the timing of latching values from the uc0 up-counter into the tb0cp0 and tb0cp1 capture registers. the interrupt setting is specified by the cpu.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 26 / 34 - 9.6 description of operations for each mode 9.6.1 16-bit interval timer mode -generating interrupts at periodic cycles to generate the inttb01 interrupt, specify a ti me interval in the tb0rg1 timer register. same as tb0rg0, inttb01 interrupt is generated by setting different interval time value to tb0rg1 timer resister, 9.6.2 16-bit event counter mode it is possible to make it the event counter by using an input clock as an external clock (tb0in pin input). the up-counter counts up on the rising edge of tb 0in pin input. it is possible to read the count value by capturing value using software and reading the captured value. to use it as an event counter, put the pr escaler in a ?run? state (tb0run = ?1?).
tmpm380/m382 tmpm380/m382 - 27 / 34 - ? 9.6.3 16-bit programmable square wave output mode (ppg) square waves with any frequency and any dut y (programmable square waves) can be output. the output pulse can be either low-active or high-active. programmable square waves can be output fr om the tb0out pin by triggering the timer flip-flop (tb0ff) to reverse when the set value of the up-counter (uco) matches the set values of the timer registers (tb0rg0 and tb0r g1). note that the set values of tb0rg0 and tb0rg1 must satisfy the following requirement: (set value of tb0rg0) < (set value of tb0rg1) match with tb0rg0 (inttb00 interrupt) match with tb0rg1 (inttb01 interrupt) tb0out pin fig 9-3 example of output of programmable square wave (ppg) in this mode, by enabling the double buffering of tb0rg0 and tb0rg1, the value of register buffers are shifted into tb0rg0 and tb 0rg1 when the set value of the up-counter matches the set value of tb0rg1. since software writing time is secured by double buffer, this facilitates handling of small duties pulse. q 1 q 2 q 2 q 3 tri gg er to shif t to tb0rg1 up-counter = q 1 u p-counter = q 2 match with tb0rg0 match with tb0rg1 tb0rg0 ( com p ar e val u e ) re g ister buf fer write tb0rg0 fig 9-4 register buffer operation
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 28 / 34 - the block diagram of this mode is shown below. selector selector tb0cr match tb0rg0 16-bit comparat or register buffer 0 16-bi t up-c ounter uc0 f/f (tb0ff0) 16-bit comparator internal data bus tb0rg1 tb0rg0-w r tb0in t1 t4 t1 6 tb0out (ppg output ) tb0run clear r egister buffer 1 fig 9-5 block diagram of 16-bit ppg mode each register in the 16-bit ppg output mode must be programmed as listed below. 7 6 5 4 3210 tb0en 1 x x x x x x x starts the tmrb0 module. tb0run x x x x x 0 x 0 stops the tmrb0 tb0rg0 * * * * **** specifies a duty. (16 bits *32-bits register l ength) * * * * **** tb0rg1 * * * * **** specifies a cycle. (16 bits *32-bits register l ength) * * * * **** tb0cr 1 0 x 0 0000 e nables the tb0rg0 double buffering. (changes the duty/cycle when the inttb0 interrupt is generated) tb0ffcr x x 0 0 1110 specifies to tri gger tb0ff0 to reverse when a match with tb0rg0 or tb0rg1 is detected, and sets the initial value of tb0ff0 to "0." tb0mod 0 0 1 0 0 1 * * designates the prescaler output clock as the input clock, (** = 01, 10, 11) and disables the capture function. pacr ? ? ? ? ? ? 1 pafr1 ? ? ? ? ? 1 assigns pa0 to output and tb0out tb0run * * * * * 1 x 1 starts tmrb0 x; don?t care ? ; no change
tmpm380/m382 tmpm380/m382 - 29 / 34 - 9.6.4 external trigger programmable square wave output mode (ppg) using an external count start trigger enables one-shot pulse generation with a short delay. (1) the 16-bit up-counter (uc0) is programmed to count up on the rising edge of the tb0in pin (tb0cr=?01?). the tb0rg0 is loaded with the pulse delay (d), and the tb0rg1 is loaded with the sum of the tb0rg0 value (d) and the pulse width (p). the above settings must be done while the 16-bit up-counter is stopped (tb0run=0). (2) to enable the trigger for timer flip-flop, sets tb0ffcr to 11. with this setting, the timer flip-flop reverses when 16-bi t up-counter (uc0) corresponds to tb0rg0 or tb0rg1. (3) sets tb0run to 1 to enable the count-up by an external trigger. ? (4) after the generation of one-shot pulse by the ex ternal trigger, to disable reverse of the timer flip-flop or to stop 16bit counter by tb0run setting. ? ? figure 9-5 shows one-shot pulse generation, with annotations showing (d) and (p). tb0out (timer output) pin d + p d 0 toggle is disabled for a capture into c ap1. tog gle is enabled. (p) (d) pulse delay toggle is enabled. inttb01 is generated. counter clock (presc aler output clock) the c ounter starts at the rising edge of ext ernal trigger. tb0in input pin (external trigger pulse) tb0rg0 match tb0rg1 match intt b00 is gener ated. ? fig. 9-5 one-shot pulse generation using an external count start trigger (with a delay) ?
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 30 / 34 - 9.6.5 synchronous timer mode taking the synchronization of the start between timers by using the timer synchronous mode becomes possible. it is possible to apply it to the drive such as motors by using the synchronous mode by the ppg output. the synchronous mode is switched by tbxcr. =?0? : it operates according to t he timing of each ch of the timer. =?1? : it outputs it synchronously. it divides into two blocks of tmrb0,1,2,3 and tmrb4,5,6,7. when i set =?1", i will not start in timer start tb xrun=?1, 1? of each ch, and start synchronizing with tmrb0 and tmrb4. synchronous timer output control register (x=0~7) 7 6 5 4 3 2 1 0 bit symbol tbwbf tbsync i2tb trgsel cssel read/write r/w r/w r/w r r/w r r/w r/w after reset 0 0 0 0 0 0 0 0 function double buffer 0: disabled 1: enabled write ?0? sync. mode select 0:asyunc 1:syunc ?0? is read during idle mode 0:stop 1:operation ?0? is read external trigger 0: rising edge 1: falling edge counter start 0: software start 1: external trigger in the idle mode, it is possible to select it. the timer output can be synchronized with each 4ch. please always set the tbsync bit to "0" about tmrb0,4 to have decided a synchronous start. please set the tbsync bit to "1" about the timer begun subordinating it. a double buffer of the timer register is controlled. (note1) please set the timer that outputs t he same period to tbxrun=?1,1" before it starts by tmrb0,4. (note2) please set things except a synchronous output mode to tbxcr=?0". other timers do not start until tmrb0,4 star t when a synchronous output mode is set. tbxcr (0x4001_0xx8)
tmpm380/m382 tmpm380/m382 - 31 / 34 - 9.7 application example using the capture function the capture function can be used to develop ma ny applications, including those described below: (1) one-shot pulse output triggered by an external pulse (2) frequency measurement (3) pulse width measurement ( 1 ) one-shot pulse output triggered by an external pulse one-shot pul se output triggered by an external pulse is carried out as follows: the 16-bit up-counter is made to count up by putting it in a free-running state using the prescaler output clock. an external pulse is input through the tb0in pin. a trigger is generated at the rising of the external pulse by using the capture function and the value of the up-counter is taken into the capture registers (tb0cp0). the cpu must be programmed so that an interrupt intcap00 is generated at the rising of an external trigger pulse. this interrupt is used to set the timer registers (tb0rg0) to the sum of the tb0cp0 value (c) and the delay time (d), (c + d), and set the timer registers (tb0rg1) to the sum of the tb0rg0 values and the pulse width (p) of one-shot pulse, (c + d + p). tb0rg1 change must be completed before the next match. in addition, the timer flip-flop control registers (t b0ffcr) must be set to ?11.? this enables triggering the timer flip-flop (t b0ff0) to reverse when uc0 matches tb0rg0 and tb0rg1. this trigger is disabled by the in ttb01 interrupt after a one-shot pulse is output. symbols (c), (d) and (p) used in the te xt correspond to symbols c, d and p in fig 9-6 one-shot pulse output (with delay) .? timer output tb0outpin c + d + p c + d c disable reverse when data is taken int o cap0 enable reverse (p) (d) pulse width delay time ena ble reverse inttb01 generation taking data into the capture register (tb0cp0) int cap00 generation count clock (presc aler output clock) put the counter in a free-running state. tb0in pin input (external trigger pulse) match with tb0rg0 match with tb0rg1 in ttb00 fig 9-6 one-shot pulse output (with delay) note: the value of tbnrg0/1 must be set as tbnrg0 < tbnrg1 in ppg mode.
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 32 / 34 - if a delay is not required, tb0ff0 is reversed when da ta is taken into tb0cp0, and tb0rg1 is set to the sum of the tb0cpo value (c) and the one-shot pulse width (p), (c + p), by generating the inttb00 interrupt. tb0rg1 change must be complet ed before the next match. tb0ff0 is enabled to reverse when uc0 matches with tb0rg1, and is disabled by generating the inttb01 interrupt. c + p c enable reverse (p) pulse width taking data into the capture register tb0cp0. intcap00 generation count clock (prescaler output clock) tb0in input (external trigger pulse) match with tb0rg1 timer output tb0out pin taking data into the captur e register tb0cp1 inttb01 generation enable reverse when dat a is taken into tb0cp0 disable revers e when data is taken into tb0cp1 fig 9-7 one-shot pulse output trigger ed by an external pulse (without delay)
tmpm380/m382 tmpm380/m382 - 33 / 34 - ( 2 ) frequency measurement the frequency of an external clock can be measured by using the capture function. to measure frequency, another 16-bit timer is used in combination with the 16-bit event counter mode. as an example, we explain with tmrb0 a nd tmrb7. tb7out of the 16-bit timer tmrb7 is used to specify the measurement time. the tb0in pin input is selected as the tmrb0 c ount clock to perform the count operation using an external input clock. tb0mod is set to ?11.? this setting allows a count value of the 16-bit up-counter uc to be taken into the capt ure register (tb0cp0) upon rising of a timer flip-flop output (tb7out) of the 16-bit timer (tmr b7), and an uc counter value to be taken into the capture register (tb0cp1) upon falling of tb7out of the 16-bit timer (tmrb7). a frequency is then obtained from the difference between tb0cp0 and tb0cp1 based on the measurement, by generating the inttb70 and inttb71 16-bit timer interrupt. fig 9-8 frequency measurement for example, if the set width of tb7ff0 level ?1? of the 16-bit timer is 0.5 s and if the difference between tb0cp0 and tb0cp1 is 100, the frequency is 100 / 0.5 s = 200 hz. c2 c1 c2 c1 c2 c1 count clock (tb0in pin input) tb7out taking data into tb0cp0 taking data into tb0cp1 inttb70 inttb71
9 16-bit timer/event counters (tmrbs) tmpm380/m382 tmpm380/m382 - 34 / 34 - ( 3 ) pulse width measurement by using the captur e function, the ?h? level width of an external pulse can be measured. specifically, by putting it in a free-running state using the presca ler output clock, an external pulse is input through the tb0in pin and the up-counter (uc0) is made to count up. a trigger is generated at each rising and falling edge of the external pulse by using the c apture function and the value of the up-counter is taken into the capture registers (tb0cp0, tb0cp1). the cpu must be programmed so that intcap01 is generated at the falling edge of an ex ternal pulse input through the tb0in pin. the ?h? level pulse width can be calculated by multiplying the difference between tb0cp0 and tb0cp1 by the clock cycle of an internal clock. for example, if the difference between tb0cp0 an d tb0cp1 is 100 and the cycle of the prescaler output clock is 0.5 us, the pulse width is 100 0.5 us = 50 us. caution must be exercised when measuring pulse widths exceeding the uc0 maximum count time which is dependant upon the source clock used. th e measurement of such pulse widths must be made using software. c2 c1 c2 c2 c1 prescaler output clock tb0in pin input (external pulse) taking data into tb0cp0 intcap00 taking data into tb0cp1 intcap01 fig 9-9 pulse width measurement the ?l? level width of an external pulse can also be measured. in such cases, the difference between c2 generated the first time and c1 generated the second time is init ially obtained by performing the second stage of intcap00 interrupt processing as shown in ? fig 9-9 pulse width measurement? and this difference is multip lied by the cycle of the prescaler output cl ock to obtain the ?l? level width.
tmpm380/m382 tmpm380/m382 - 1 / 87 - 10. 16-bit multi-purpose timers (mpts) 10.1 outline tmpm380 has three channels of 16-bit multi-purpose timer (mpt0 through mpt2). mpts operate in the following operation modes: timer module> 16-bit interval timer mode 16-bit event counter mode 16-bit programmable square-wave output mode (ppg, single wave) capture timer mode igbt module> 16-bit programmable square-wave output mode (ppg, two waves) external trigger starting period matching detection function emergency stop function pmd module> 3-phase motor control mode (pmd) note: pmd module is not available when using mpt2. important tmpm382 (64-pin version) does not implement mpt1 and mpt2. please do not use these functions if you use this product.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 2 / 87 - ? 10.2 specification differences among channels each channel (mpt0 through mpt2) operates ind ependently and the functions are the same except the differences as shown in table 10-1 . therefore, the operatio nal de scription s here are explained only for mpt0. table 10-1 differences in the specifications of mpt modules (1) external pins specification channel external clock/ capture trigger input pin timer flip-flop output pin igbt input pins igbt output pins pmd input pin pmd output pins mpt0 mttb0in mttb0out gemg0 ----------------- mt0in mtout00 mtout10 emg0 ------------- uo0,vo0, wo0,xo0, yo0,zo0 mpt1 mttb1in mttb1out gemg1 ----------------- mt1in mtout01 mtout11 emg1 ------------- uo1,vo1, wo1,xo1, yo1,zo1 mpt2 mttb2in mttb2out gemg2 ----------------- mt2in mtout02 mtout12
tmpm380/m382 tmpm380/m382 - 3 / 87 - ? 10.3 configuration mpt consists of three modules including timer (tmr), igbt and pmd as shown below. intmttb01 tmr igbt pmd intmttb00 intmtcap01 intmtcap00 to sio4(note 1) pc4 intmtemg0 pmd 0trg0 pmd 0trg1 emg0 gemg0 mt0in mttb0in mtout10 mtout00 mtt b0out trigger period match reg1 match reg0/ overflow pc 6 pc3 pc2 pc1 pc0 wo0 zo0 pc 5 yo0 vo0 xo0 uo0 pc 7 t0 intpmd0 intemg 0 to adc(note2) fsys t0 figure 10-1 mpt0 block diagram (the same applies to channels 1 through2) note1: when using mpt0 timer, timer flip-flop output (mttb0out) can be selected as a serial transfer clock for sio4 in the uart mode. ? note2: pmd module is not available when using mpt2. ?
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 4 / 87 - 10.4 registers 10.4.1 mpt registers table 10-2 shows the register names and addresses of each channel. table 10-2 mpt registers (1/3) channel specification mpt0 mpt1 mpt2 mpt enable register mt0en 0x4005_0800 mt1en 0x4005_0880 mt2en 0x4005_0900 mpt run register mt0run 0x4005_0804 mt1run 0x4005_0884 mt2run 0x4005_0904 mpt control register mt0tbcr 0x4005_0808 mt1tbcr 0x4005_0888 mt2tbcr 0x4005_0908 mpt mode register mt0tbmod 0x4005_080c mt1tbmod 0x4005_088c mt2tbmod 0x4005_090c mpt flip-flop control register mt0tbffcr 0x4005_0810 mt1tbffcr 0x4005_0890 mt2tbffcr 0x4005_0910 mpt status register mt0tbst 0x4005_0814 mt1tbst 0x4005_0894 mt2tbst 0x4005_0914 mpt interrupt mask register mt0tbim 0x4005_0818 mt1tbim 0x4005_0898 mt2tbim 0x4005_0918 mpt read capture register mt0tbuc 0x4005_081c mt1tbuc 0x4005_089c mt2tbuc 0x4005_091c mpt timer register mt0rg0 mt0rg1 0x4005_0820 0x4005_0824 mt1rg0 mt1rg1 0x4005_08a0 0x4005_08a4 mt2rg0 mt2rg1 0x4005_0920 0x4005_0924 register names (addresses) mpt capture register mt0cp0 mt0cp1 0x4005_0828 0x4005_082c mt1cp0 mt1cp1 0x4005_08a8 0x4005_08ac mt2cp0 mt2cp1 0x4005_0928 0x4005_092c table 10-3 mpt registers (2/3) channel specification mpt0 mpt1 mpt2 igbt control register mt0igcr 0x4005_0830 mt1igcr 0x4005_08b0 mt2igcr 0x4005_0930 igbt timer restart register mt0igresta 0x4005_0834 mt1igrest a 0x4005_08b4 mt2igresta 0x4005_0934 igbt timer status register mt0igst 0x4005_0838 mt1igst 0x4005_08b8 mt2igst 0x4005_0938 igbt input control register mt0igicr 0x4005_083c mt1igicr 0x4005_08bc mt2igicr 0x4005_093c igbt output control register mt0igocr 0x4005_0840 mt1igocr 0x4005_08c0 mt2igocr 0x4005_0940 igbt timer register mt0igrg2 mt0igrg3 mt0igrg4 0x4005_0844 0x4005_0848 0x4005_084c mt1igrg2 mt1igrg3 mt1igrg4 0x4005_08c4 0x4005_08c8 0x4005_08cc mt2igrg2 mt2igrg3 mt2igrg4 0x4005_0944 0x4005_0948 0x4005_094c igbt emg control register mt0igemgcr 0x4005_0850 mt1igemgcr 0x4005_08d0 mt2igemgcr 0x4005_0950 register names (addresses) igbt emg status register mt0igemgst 0x4005_0854 mt1igemgst 0x4005_08d4 mt2igemgst 0x4005_0954
tmpm380/m382 tmpm380/m382 - 5 / 87 - table 10-4 mpt registers (3/3) channel specification mpt0 mpt1 mpt2 pmd enable register mtpd0mden 0x4005_0400 mtpd1mden 0x4005_0480 na port output mode register mtpd0portmd 0x4005_0404 mt pd1portmd 0x4005_0484 na pmd control register mtpd0mdcr 0x4005_0408 mtpd1mdcr 0x4005_0488 na pwm counter status register mtpd0cntsta 0x4005_040c mtpd 1cntsta 0x4005_048c na pwm counter register mtpd0mdcnt 0x4005_0410 mtpd1mdcnt 0x4005_0490 na pwm period register mtpd0mdprd 0x4005_0414 mtpd1mdprd 0x4005_0494 na pmd compare u register mtpd0cmpu 0x4005_0418 mtpd1cmpu 0x4005_0498 na pmd compare v register mtpd0cmpv 0x4005_041c mtpd 1cmpv 0x4005_049c na pmd compare w register mtpd0cmpw 0x4005_0420 mtpd1cmpw0 0x4005_04a0 na pmd output control register mtpd0mdout 0x4005_0428 mtpd1mdout 0x4005_04a8 na pmd output setting register mtpd0mdpot 0x4005_042c mt pd1mdpot 0x4005_04ac na emg release register mtpd0emgrel 0x4005_0430 mtpd1emgrel 0x4005_04b0 na emg control register mtpd0emgcr 0x4005_0434 mtpd1emgcr 0x4005_04b4 na emg status register mtpd0emgst 0x4005_0438 mtpd1emgst 0x4005_04b8 na dead time register mtpd0dtr 0x4005_0444 mtpd 1dtr 0x4005_04c4 na trigger compare 0 register mtpd0trgcmp0 0x4005_0448 mtpd 1trgcmp0 0x4005_04c8 na trigger compare 1 register mtpd0trgcmp1 0x4005_044c mt pd1trgcmp1 0x4005_04cc na trigger control register mtpd0trgcr 0x4005_0458 mtpd1trgcr 0x4005_04d8 na register names (addresses) trigger output mode setting register mtpd0trgmd 0x4005_045c mt pd1trgmd 0x4005_04dc na na: not available.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 6 / 87 - 10.4.1.1 operating precautions for mpts note1 : do not change settings as following registers during timer is in operation (mtnrun=?1?). mtntbffcr mtntbmod mtntbcr mtnigcr mtnigicr mtnigemgcr note2 : setting of mtnrg0/1 must be set as ?value of mtnrg0 < value of mtnrg1?. note3 : setting of mtnrg0/1/2/3 /4 must be set as follows; 0 < value of mtnrg0 < value of mtnrg1 ? value of mtnigrg4 ? 0xffff 0 < value of mtnigrg2 < value of mtnigrg3 ? value of mtnigrg4 ? 0xffff note4 : write to mtnrg0/1/2/3/4 by unit of 16 bits or 32 bits. writing by units of bytes is prohibited. note5: regardless of the timer opera ting or stopping, mtoutn0 and mtoutn1 output pins change according to a setting register of igbt output control regi ster (mtnigocr). confirm the operating conditions beforehand when changing the mtnigocr setting. note6: during timer in operation, if igbt timer rest art register mtnigresta is set to ?1?, timer counter can be cleared and restarted. confirm t he operating conditions beforehand when changing the mtnigresta setting. note7: when changing the noise eliminating time setting of igbt timer trigger start pin (mtntbin) specified with mtnigcr, timer counter must be stopped. when changing the setting of the trigger start pin (mtntbin) of igbt timer, the timer must be waited to start (mtnrun=?1?) until noise elimination time (more than specified ti me for noise elimination) passes after changing setting of noise elimination time. note8: when changing the noise eliminati ng setting of gemgn pin specified with mtnigemgcr, emg protection circuit must be disabled (mtnigemgcr=?0?). note9: if mtnigcr is set to ?10? (stop counter after completing output in the current period) and stopped by mtnrun, confirm a period interrupt generation before changing the timer setting and restart. note10: while timer is stopping, a value of timer counte rs (mtucn) is not captured. since data in the capture register (mtncp0, mtncp1) is maintained, a preceding captured value of timer counter can be read.
tmpm380/m382 tmpm380/m382 - 7 / 87 - 10.4.1.2 mptn enable register mtnen (n=0,1,2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 7 6 5 4 3 2 1 0 bit symbol mten mthalt - - - - - mtmode read/write r/w r/w r r/w after reset 0 0 0 0 function mpt operation 0: disabled 1: enabled control in core halt at debug 0: disabled 1: enabled ?0? is read. operation mode 0: timer 1: igbt mten : specifies the mpt operation. when the operation is disabled, no clock is supplied to the other registers in the mpt modules. this can reduce power consumption. (this disables reading from and writing to the other registers.) mthalt : specifies the control in core halt during debug mode. [in timer mode] 0: clock not stops 1: clock stops [in igbt mode] 0: clock does not stop and not control mtout0n/mtout1n 1: clock stops and control mtout0n/mt out1n depend on mtnigemgcr setting mtmode : select operation mode 0: timer mode 1: igbt mode to use the mpt, enable the mpt operation (< mten>=?1?) before programming each register in the mpt module. after the mpt operation is executed and then disabled, the settings will be maintained in each registers.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 8 / 87 - 10.4.1.3 mpt run register mtnrun (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - - - - - mtprun - mtrun read/write r r/w r r/w after reset 0 0 0 0 function ?0? is read. prescaler ? run/stop control 0: stop and clear 1: count ?0? is read. mtp run/stop control 0: stop and clear 1: count mtrun :controls the mptn counting operation. 0: stop counting and the counter is cleared to ?0?. 1: start counter mtprun :controls the mptn prescaler operation. 0: stop prescaler operation and the prescaler is cleared to ?0?. 1: start prescaler operation.
tmpm380/m382 tmpm380/m382 - 9 / 87 - 10.4.1.4 mpt control register mtntbcr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol mttbwbf - - - mti2tb - mttbtrgsel mttbcssel read/write r/w r/w r/w r r/w r r/w r/w after reset 0 0 0 0 0 0 0 0 function double buffer control 0: disabled 1: enabled write ?0?. write ?0?. ?0? is read. operation in idle mode 0:stop 1:operation ?0? is read. external trigger selection 0: rising edge 1: falling edge counter start selection 0: software start 1: external trigger : selects how the timer starts counting. 0: select software for timer count start. 1: select external trigger for timer count start. : selects the active edge of the external trigger signal. 0: select rising edge of external trigger. 1: select falling edge of external trigger. : controls the clock suply to keep/stop in the idle mode. 0: stop the clock. 1: keep clock operation during idle mode. :controls the enabling/disabling of double buffering. 0: disable double buffer. 1: enable double buffer. (note1) mtntbcr resister must not be changed during timer in operation (mtnrun=?1?) (note2) regardless of the setting, double buffer is enabled automatically during igbt mode.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 10 / 87 - 10.4.1.5 mpt mode register mtntbmod (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - mttbrswr mttbcp mttbcpm1 mttbcpm0 mttbcle mttbclk1 mttbclk0 read/write r r/w w r/w r/w r/w after reset 0 0 1 0 0 0 0 0 function ?0? is read. writes to timer registers 0 and 1 (when mttbwbf=1) 0: can be written separately 1: must be written simultaneo usly software capture control 0: software capture 1: don't care capture timing 00: disable 01: mtntbin 10: mtntbin mtntbin 11: disable up-counter control 0:disable clearing 1: enable clearing source clock for timer 00: mtntbin pin input 01: t1 10: t4 11: t16 mttbclk1:0 :selects the mpt timer count source clock. 00: select mtntbin input pin 01: select t1 (1/2 t0) 10: select t4 (1/8 t0) 11: select t16 (1/32 t0) mttbcle :clears and controls the mptn up-counter. ?0?: disables clearing of the up-counter. ?1?: clears up-counter if there is a match with timer register 1 (mtnrg1). mttbcpm1:0 :specifies mptn capture timing. ?00?: capture disable ?01?: takes count values into capture regist er 0 (mtncp0) upon rising of mtntbin pin input. ?10?: takes count values into capture regi ster 0 (mtncp0) upon rising of mtntbin pin input. takes count values into capture register 1 (mtncp1) upon falling of mtntbin pin input. ?11?: capture disable
tmpm380/m382 tmpm380/m382 - 11 / 87 - mttbcp :captures count values by software and take s them into capture register 0 (mtncp0). : controls the timing to write to timer registers 0 and 1 when double buffering is enabled. ?0?: timer registers 0 and 1 can be written se parately, even in case writing preparation is ready for only one resister. ?1?: in case both resisters are not ready to be written, timer registers 0 and 1 cannot be written. (note 1) the value read from mtntbmod is ?1?. (note 2) mtnmod register must not be changed during timer in operation (mtnrun=?1?)
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 12 / 87 - 10.4.1.6 mpt flip-flop control register mtntbffcr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read 7 6 5 4 3 2 1 0 bit symbol - - mttbc1t1 mttbc0t1 mttbe1t1 mttbe0t1 mttbff0c1 mttbff0c0 read/write r r/w r/w after reset 1 1 0 0 0 0 0 0 mtnff0 reverse trigger control 0: disable trigger 1: enable trigger function ?11? is read. when the up-counter value is taken into mtncp1 when the up-counter value is taken into mtncp0 when the up-counter matches mtnrg1 when the up-counter matches mtnrg0 mtnff0 control 00: invert 01: set 10: clear 11: don't care * this is always read as ?11.? mttbff0c1:0 :controls the timer flip-flop. 00 : reverses the value of mtnff0 01 : sets mtnff0 to ?1?. 10 : clears mtnff0 to ?0?. 11 :don?t care mttbe0t1 :reverses the timer flip-flop when the up-count er matches the timer register 0 (mtnrg0). 0: mtnff0 not reverse 1: mtnff0 reverse mttbe1t1 :reverses the timer flip-flop when the up-count er matches the timer register 1 (mtnrg1). 0: mtnff0 not reverse 1: mtnff0 reverse mttbc0t1 :reverses the timer flip-flop when the up-counter value is taken into the capture register 0 (mtncp0). 0: mtnff0 not reverse 1: mtnff0 reverse
tmpm380/m382 tmpm380/m382 - 13 / 87 - mttbc1t1 :reverses the timer flip-flop when the up-counter value is taken into the capture register 1 (mtncp1). 0: mtnff0 not reverse 1: mtnff0 reverse (note) mtntbffcr register must not be changed during timer in operation (mtnrun =?1?).
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 14 / 87 - 10.4.1.7 mpt status register mtntbst (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - - - - - mttbinttb of mttbinttb 1 mttbinttb 0 read/write r r after reset 0 0 0 0 function ?0? is read. 0: no interrupt generated 1:interrupt generated 0: no interrupt generated 1:interrupt generate d 0: no interrupt generated 1:interrupt generate d mttbint0 :interrupt generated status for a match with timer register 0 (mtnrg0) 0: no interrupt generated 1: interrupt generated (intmtntb0) mttbint1 :interrupt generated status for a match with timer register 1 (mtnrg1) 0: no interrupt generated 1: interrupt generated (intmtntb1) mttbintof :interrupt generated status for an up-counter overflow occurs 0: no interrupt generated 1: interrupt generated (intmtntb0) (note) if any interrupt is generated, the flag that corresponds to the interrupt is set to mtntbst and the generation of interrupt is notified to the cpu. the flag is cleared by reading the mtntbt register.
tmpm380/m382 tmpm380/m382 - 15 / 87 - 10.4.1.8 mpt interrupt mask register mtntbim (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol - - - - - mttbimof mttbim1 mttbim0 read/write r r/w after reset 0 0 0 0 function ?0? is read 0: no interrupt mask 1: interrupt is masked 0: no interrupt mask 1: interrupt is masked 0: no interrupt mask 1: interrupt is masked mttbim0 : interrupt mask for a match wi th timer register 0 (mtnrg0) 0: no interrupt mask 1: interrupt is masked mttbim1 :interrupt mask for a match with timer register 1 (mtnrg1). 0: no interrupt mask 1: interrupt is masked mttbimof :interrupt mask for an up counter overflow. 0: no interrupt mask 1: interrupt is masked (note) even in case mtntbim set interrupt ma sk, mtntbst register has an interrupt requested status.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 16 / 87 - 10.4.1.9 mpt read capture register mtntbuc (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol mtuc15 mtuc14 mtuc13 mtuc12 mtuc11 mtuc10 mtuc9 mtuc8 read/write r after reset 0 function data obtained by read capture: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol mtuc7 mtuc6 mtuc5 mtuc4 mtuc3 mtuc2 mtuc1 mtuc0 read/write r after reset 0 function data obtained by read capture: 7-0 bit data captured up-counter value.
tmpm380/m382 tmpm380/m382 - 17 / 87 - 10.4.1.10 mpt timer register mtnrg0 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol mtrg015 mtrg014 mtrg013 mtrg012 mtrg011 mtrg010 mtrg09 mtrg08 read/write r/w after reset 0 function timer count value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol mtrg07 mtrg06 mtrg05 mtrg04 mtrg03 mtrg02 mtrg01 mtrg00 read/write r/w after reset 0 function timer count value: 7-0 bit data 16bit compare value0 with up- counter [timer mode] when up-counter value match with mtnrg0[15:0], intmttbn0 is generated. and it can use to invert tmtbnout output. [igbt mode] when up-counter value match with mtnrg0[15:0], mtout0n output is changed to active level. note: write to this register by unit of 16 bits or 32 bits. writing by unit of 8 bits is prohibited.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 18 / 87 - mtnrg1 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol mtrg115 mtrg114 mtrg113 mtrg112 mtrg111 mtrg110 mtrg19 mtrg18 read/write r/w after reset 0 function timer count value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol mtrg17 mtrg16 mtrg15 mtrg14 mtrg13 mtrg12 mtrg11 mtrg10 read/write r/w after reset 0 function timer count value: 7-0 bit data 16bit compare value1 with up- counter [timer mode] when up-counter value match with mtnrg1[15:0], intmttbn1 is generated. and it can use to invert mtntbout output. [igbt mode] when up-counter value match with mtnrg1[15:0], mtout0n output is changed to inactive level. note: write to this register by unit of 16 bits or 32 bits. writing by unit of 8 bits is prohibited.
tmpm380/m382 tmpm380/m382 - 19 / 87 - 10.4.1.11 mpt capture register mtncp0 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol mtcp015 mtcp014 mtcp013 mtcp012 mtcp011 mtcp010 mtcp09 mtcp08 read/write r after reset 0 function timer capture value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol mtcp07 mtcp06 mtcp05 mtcp04 mtcp03 mtcp02 mtcp01 mtcp00 read/write r after reset 0 function timer capture value: 7-0 bit data : 16 bit up-counter capture value 0 mtncp1 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol mtcp115 mtcp114 mtcp113 mtcp112 mtcp111 mtcp110 mtcp19 mtcp18 read/write r after reset 0 function timer capture value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol mtcp17 mtcp16 mtcp15 mtcp14 mtcp13 mtcp12 mtcp11 mtcp10 read/write r after reset 0 function timer capture value: 7-0 bit data : 16 bit up-counter capture value 1
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 20 / 87 - 10.4.1.12 igbt control register mtnigcr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - igidis igprd1 igprd0 read/write r r r r r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read interrupt control when command start 0: enable 1: disable interrupt period selection 00: every one- period 01: every two- period 10: every four- period 11: reserved 7 6 5 4 3 2 1 0 bit symbol - igsngl igstp1 igstp0 igsta1 igsta0 igclk1 igclk0 read/write r r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read igbt operation mode 0: continuous output 1: one- time output select the state when stopped. 00: immediately stop a with output initialize d 01: immediately stop and clear counter with output maintained 10: stop counter after completing output in the current period. 11: reserved start mode selection 00: command start and trigger capture mode 01: command start and trigger start mode 10: trigger start mode 11: reserved source clock for igbt 00: t0 01: t1 10: t2 11: t4
tmpm380/m382 tmpm380/m382 - 21 / 87 - interrupt control when command start ?0? enable ?1? disable interrupt period selection ?00? every one-period ?01? every two-period ?10? every four-period ?11? reserved igbt operation mode ?0? continuous output ?1? one- time output select the state when stopped. ?00? immediately stop and counter with output initialized ?01? immediately stop and clear counter with output maintained ?10? stop counter after completing output in the current period ?11? reserved start mode selection ?00? command start and trigger capture mode ?01? command start and trigger start mode ?10? trigger start mode ?11? reserved igclk1:0> source clock selection for igbt ?00? select t0 (1/1 t0) ?01? select t1 (1/2 t0) ?10? select t2 (1/4 t0) ?11? select t4 (1/8 t0) (note) mtnigcr register must not be chan ged during timer in operation (mtnrun=?1?).
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 22 / 87 - 10.4.1.13 igbt timer restart register mtnigresta (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - - - - - - - igresta read/write r r r r r r r w after reset 0 0 0 0 0 0 0 0 function ?0? is read. count restart control 0: don?t care 1: restart (?0? is read.) count restart control ?0? don?t care ?1? restart (counter clear & start)
tmpm380/m382 tmpm380/m382 - 23 / 87 - 10.4.1.14 igbt timer status register 2, 3, 4 mtnigst (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - - - - - - - igst read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read. counter status 0: stop 1: operatin g counter status ?0? stop ?1? operating
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 24 / 87 - 10.4.1.15 igbt input control register mtnigicr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol igtrgm igtrgsel - - igncsel3 igncsel2 igncsel1 igncsel0 read/write r/w r/w r r r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function trigger edge acceptanc e mode 0: always accept trigger edges 1: do not accept trigger edges during active output select trigger start edge 0: start on trigger rising edge 1: start on trigger falling edge ?0? is read select the duration of noise elimination for input 0000: no elimination (note) 0001: eliminate pulses shorter than 16 / fsys[s] 0010: eliminate pulses shorter than 32 / fsys[s] : 1111: eliminate pulses shorter than 240 / fsys[s] trigger edge acceptance mode ?0? always accept trigger edges ?1? do not accept trigger edges during active output select trigger start edge/ active level selection ?0? start on trigger rising edge/ ?high? level active ?1? start on trigger falling edge/ ?low? level active
tmpm380/m382 tmpm380/m382 - 25 / 87 - select the duration of noise elimination for input the noise elimination time is calculated in the formula shown in below. igncsel[3:0]16 / fsys 0000: no elimination 0001: eliminate pulses shorter than 16 / fsys[s] 0010: eliminate pulses shorter than 32 / fsys[s] 0011: eliminate pulses shorter than 48 / fsys[s] 0100: eliminate pulses shorter than 64 / fsys[s] 0101: eliminate pulses shorter than 80 / fsys[s] 0110: eliminate pulses shorter than 96 / fsys[s] 0111: eliminate pulses shorter than 112 / fsys[s] 1000: eliminate pulses shorter than 128 / fsys[s] 1001: eliminate pulses shorter than 144 / fsys[s] 1010: eliminate pulses shorter than 160 / fsys[s] 1011: eliminate pulses shorter than 176 / fsys[s] 1100: eliminate pulses shorter than 192 / fsys[s] 1101: eliminate pulses shorter than 208 / fsys[s] 1110: eliminate pulses shorter than 224 / fsys[s] 1111: eliminate pulses shorter than 240 / fsys[s] (note) mtnigicr register must not be changed during the timer in operation (mtnrun=?1?).
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 26 / 87 - 10.4.1.16 igbt output control register mtnigocr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol - - igpol1 ig pol0 - - igoen1 igoen0 read/write r r r/w r/w r r r/w r/w after reset 0 0 0 0 0 0 0 0 function ?0? is read specify initial value of mtout1n output 0: low 1: high specify initial value of mtout0n output 0: low 1: high ?0? is read mtout1n output control 0: disable 1: enable mtout0n output control 0: disable 1: enable initial value of mtout1n output ?0? low ?1? high initial value of mtout0n output ?0? low ?1? high mtout1n output control ?0? disable ?1? enable mtout0n output control ?0? disable ?1? enable
tmpm380/m382 tmpm380/m382 - 27 / 87 - 10.4.1.17 igbt timer register mtnigrg2 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol igrg215 igrg214 igrg213 igrg212 igrg211 igrg210 igrg29 igrg28 read/write r/w after reset 0 function igbt timer value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol igrg27 igrg26 igrg25 igrg24 igrg23 igrg22 igrg21 igrg20 read/write r/w after reset 0 function igbt timer value: 7-0 bit data : when match with up-counter, mtout1n is changed to active level. note1: setting value: mt nigrg2 10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 28 / 87 - mtnigrg3 (n=0,1,2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol igrg315 igrg314 igrg313 igrg312 igrg311 igrg310 igrg39 igrg38 read/write r/w after reset 0 function igbt timer value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol igrg37 igrg36 igrg35 igrg34 igrg33 igrg32 igrg31 igrg30 read/write r/w after reset 0 function igbt timer value: 7-0 bit data : when match with up-counter, mtout1n change to inactive level. note1: setting value: mt nigrg2 tmpm380/m382 tmpm380/m382 - 29 / 87 - mtnigrg4 (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol igrg415 igrg414 igrg413 igrg412 igrg411 igrg410 igrg49 igrg48 read/write r/w after reset 0 function igbt timer value: 15-8 bit data 7 6 5 4 3 2 1 0 bit symbol igrg47 igrg46 igrg45 igrg44 igrg43 igrg42 igrg41 igrg40 read/write r/w after reset 0 function igbt timer value: 7-0 bit data : set the igbt period. note1: setting value: mt nigrg2 10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 30 / 87 - 10.4.1.18 igbt emg control register mtnigemgcr (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol igemgcnt3 igemgcnt2 igemgcnt1 igemgcnt0 ? igemgrs igemgoc igemgen read/write r/w r/w r/w r/w r w r/w r/w after reset 0 0 0 0 0 0 0 0 function select the duration of noise elimination for gemg input 0000: no elimination (note) 0001: eliminate pulses shorter than 16 / fsys[s] 0010: eliminate pulses shorter than 32 / fsys[s] : 1111: eliminate pulses shorter than 240 / fsys[s] ?0? is read cancel emg state 0: don?t care 1: cancel mtout0n / mtout1n output control in emg 0: inactive level 1: hi-z emg circuit control 0: disable 1: enable select the duration of noise elimination for gemgn input the noise elimination time is calculated in the formula shown in below. igemgcnt[3:0]16 / fsys 0000: no elimination 0001: eliminate pulses shorter than 16 / fsys[s] 0010: eliminate pulses shorter than 32 / fsys[s] 0011: eliminate pulses shorter than 48 / fsys[s] 0100: eliminate pulses shorter than 64 / fsys[s] 0101: eliminate pulses shorter than 80 / fsys[s] 0110: eliminate pulses shorter than 96 / fsys[s] 0111: eliminate pulses shorter than 112 / fsys[s] 1000: eliminate pulses shorter than 128 / fsys[s] 1001: eliminate pulses shorter than 144 / fsys[s] 1010: eliminate pulses shorter than 160 / fsys[s] 1011: eliminate pulses shorter than 176 / fsys[s] 1100: eliminate pulses shorter than 192 / fsys[s] 1101: eliminate pulses shorter than 208 / fsys[s] 1110: eliminate pulses shorter than 224 / fsys[s] 1111: eliminate pulses shorter than 240 / fsys[s]
tmpm380/m382 tmpm380/m382 - 31 / 87 - cancel the emergency output state. upon canceling the state, this bit is automatically cleared to ?0? ?0? don?t care ?1? cancel mtout0n/1n output control in emg ?0? inactive level ?1? hi-z emg circuit control ?0? disable ?1? enable
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 32 / 87 - 10.4.1.19 igbt emg status register mtnigemgst (n=0, 1, 2) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol - - - - - - igemgin igemgst read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function ?0? is read status of emg input after noise elimination 0: low 1: high status of emg protection 0: normal operation 1: protected status of emg input after noise elimination ?0? low ?1? high status of emg protection ?0? normal operation ?1? protect the emg protection state can be known by reading this bit.
tmpm380/m382 tmpm380/m382 - 33 / 87 - 10.4.1.20 registers for pmd function please refer to pmd mode (programmable motor driver).
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 34 / 87 - ? 10.5 description of operations for timer mode the channels operate in the same way, except for the differences in their specifications as shown in table 10-1. therefore, the operational descripti on s here are only for channel 0. 10.5.1 configuration figure 10-2 timer mode block diagram inernal data bus run/ clear ? match detection ? 16-bit conparator ( cp0 ) mpt register0 mt0rg0 count clock mt0tbmod mt0tbmod prescaler clock: t0 mttb0in t1 t4 t16 mt0tbmod capture regisier0 mt0cp0 mt0tbmod capture regisier1 mt0cp1 8 4 2 t4 t16 mt0run inernal data bus timer flip-flop control mt0ff0 tim er flip-flop ? mtp0 interrupt in tm ttb 01 ti mer flip-flop output ? mttb0out ? o verflow interru p t out p ut ca pture control 16-bit up counter (mtuc0) status register mt0tbst r e g ister 0 interru p t out p ut r e g ister 1 interru p t out p ut t1 16 32 up counter mt0tbuc capt ure interrupt intmtcap00 intmtcap01 mt0tbcr < mttbwbf > mt0tbffc r 16-bit conparator ( cp1 ) mpt register1 mt0rg1 overflow interru p t mask int er rup t ma sk reg ister mt0tbim re g ister 0 interru p t mas k re g ister 1interru p t mask register buffer 1 register buf fer0 prescaler up counter control ru n/ clear ? intmttb00 match detection ?
tmpm380/m382 tmpm380/m382 - 35 / 87 - 10.5.2 prescaler there is a 4-bit prescaler to gener ate the source clock for up-counter mtuc0. the prescaler input clock t0 is fperiph, fperiph/2, fperiph/4, fper iph/8, fperiph/16 or fperiph/32 selected by cgsyscr in the cg. the peripheral clock, fperiph, is either fgear, a clock selected by cgsyscr in the cg, or fc , which is a clock before it is divided by the clock gear. the operation or the stop of a prescaler is set with mtp0run where writing ?1? starts counting and writing ?0? clears and stops counting. table 10-5 shows prescaler output clock re solut i ons.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 36 / 87 - table 10-5 prescaler output clock resolutions at fc = 40mhz prescaler output clock resolution clear peripheral clock clock gear value prescaler clock selection t1 t4 t16 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 001(fperiph/2) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 010(fperiph/4) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 011(fperiph/8) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 100(fperiph/16) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fc/2) 101(fperiph/32) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 101(fc/4) 101(fperiph/32) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 001(fperiph/2) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 010(fperiph/4) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 011(fperiph/8) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 100(fperiph/16) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 0 (fgear) 110(fc/8) 101(fperiph/32) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 100(fc/2) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 101(fc/4) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 1 (fc) 110(fc/8) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s)
tmpm380/m382 tmpm380/m382 - 37 / 87 - (note 1) the prescaler output clock tn must be selected as tn 10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 38 / 87 - ? 10.5.3 up-counter (mtuc0) mtuc0 is a 16-bit binary counter. source clock mtuc0 source clock, specified by mt0t bmod, can be selected from either three types t1, t4 and t16 of prescaler output clock or the external clock of the mttb0in pin. count start/ stop counter operation is specified by mt0 run. mtuc0 starts counting if = ?1?, and stops counting and cl ears counter value if = ?0?. timing to clear mtuc0 1) when a compare match is detected by setting mt0tbmod = ?1?, mtuc0 is cleared in case the comparator detects a match between counter value and t he value set in mt0rg1. mtuc0 operates as a free-running counter if mt0tbmod = ?0?. 2) when mtuc0 stops mtuc0 stops counting and clears coun ter value if mt0run = ?0?. mtuc0 overflow if mtuc0 overflow occurs, the intmttb 00 overflow interrupt is generated. ? 10.5.4 timer registers (mt0rg0, mt0rg1) mt0rg0 and mt0rg1 are registers for setting values to compare with up-counter values and two registers are built into each channel. if the comparator detects a match between a value set in this timer register and that in a mtuc0 up-counter, it outputs the match detection signal. configuration mt0rg0 and mt0rg1 of this timer registers are paired with register buffer - the double-buffered configuration. the two registers use mt0tbcr to control the enabling/disabling of double buffering. if = ?0?, double buffering is disabled and if = ?1?, it is enabled. if double buffering is enabled, data is transferred from register buffer to the mt0rg0 and mt0r g1 timer registers wh en there is a match between mtuc0 and mt0rg1. default setting the values of mt0rg0 and mt0rg1 become undefined after a reset. a reset disables the double buffer.
tmpm380/m382 tmpm380/m382 - 39 / 87 - register setting 1) when not using double-buffering to write data to the timer registers, either a 2-byte data transfer instruction or a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by high-order 8 bits can be used. 2) when using double-buffering mt0rg0/ mt0rg1 and the register buffers are assigned to the same address. if = ?0,? the same value is written to mt0rg0, mt0rg1 and each register buffer; if = ?1? the value is only written to each register buffer. therefore, in order to write an initial value to the timer register, the register buffers must be set to ?disable?. then set = ?1?and write the following data to the register. 10.5.5 capture control this is a circuit that controls the timing to latch mtuc0 up-counter values into the mt0cp0 and mt0cp1 capture registers. the timing to latch data is specified by mt0tbmod . software can also be used to capture values from the mtuc0 up-counter into the capture register; specifically, mtuc0 values are taken into the mt0cp0 capture register each time ?0? is written to mt0tbmod. to use this capability, the prescaler must be running (mt0run = ?1?). ? 10.5.6 capture registers (mt0cp0, mt0cp1) these are 16-bit registers for latching values from the mtuc0 up-counter. to read data from the capture register, use a 16-bit data transfer inst ruction or read in the order of low-order bits followed by high-order bits. 10.5.7 up-counter capture register (mt0uc) other than the capturing functions shown above, the current count value of the mtuc0 can be captured by reading the mtuc0 registers. 10.5.8 comparators (mt0cp0, mt0cp1) these are 16-bit comparators for detecting a match by comparing set values of the mtuc0 up-counter with set values of the mt0rg0 and mt 0rg1 timer registers. if a match is detected, intmttb00 and intmttb01 are generated. 10.5.9 timer flip-flop (mt0ff0) the timer flip-flop (mt0ff0) is reversed by a match signal from the comparator and a latch signal to the capture registers. it can be enabled or disabled to reverse by setting the mt0tbffcr. the value of mt0ff0 becomes undefined after a reset. the flip-flop can be reversed by
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 40 / 87 - writing ?00? to mt0tbffcr. it can be set to ?1? by writing ?01,? and can be cleared to ?0? by writing ?10.? the mt0ff0 value can be output to the timer output pin:mttb0out. to enable timer output, the port c related registers pccr and pcfr2 must be programmed beforehand. 10.5.10 capture interrupt (intmtcap00, intmtcap01) interrupts intmtcap00 and intmtcap01 can be ge nerated at the timing of latching values from the mtuc0 up-counter into the mt0cp0 and mt0cp1 capture registers. the interrupt setting is specified by the cpu.
tmpm380/m382 tmpm380/m382 - 41 / 87 - 10.6 description of operations for igbt mode (igbt) the channels operate in the same way, except for the differences in their specifications as shown in table 10-1. therefore, the operational descripti on s here are only for channel 0. 10.6.1 configuration run/ clear ? 16- bit comparator ( cp0 ) mpt re gister mt 0 r g0 mt0igcr selecter prescaler clock: t0 mt0in t0 t1 t2 t4 mt 0ru n mt 0m od mt0igresta 4 2 1 t2 t4 mt 0r un mtout00 period interrupt intmt tb00 capture contr ol 16-bit up counter (mtuc0) t0 8 t1 register buffer 0 match de t ec tio n ? 16 -bit comparator ( cp1 ) mpt re gister mt 0 r g 1 register buffer1 inernal data bus 16 -bit comparator ( cp2 ) igbt tim er r eg ist er mt 0 r g 2 register buffer2 16-bit comparator ( cp3 ) igbt timer register mt 0 r g 3 register buffer3 16 -bit comparator ( cp4 ) igbt tim er r eg ister mt 0 r g 4 register buffer4 time r flip-flop control in te rr upt c ontrol mtout10 noise canceller mt0igcr clear ? i gb t time r status register mt0i gst i nernal dat a bus captu re r egister0 mt0cp0 capture register1 mt0cp1 gemg0 noise canceller mt0igic r mt0igemgcr < igemgcnt3 : 0> c ount clock ed ge detection timer start clear control start/clear ? protection contr ol circuit i gb t e mg status r egi ster mt0igemgst mt0igemgc r mt 0ioc r time r flip-flop control trigger start interrupt intmttb01 emginterrupt intmtemg0 c apture interrupt intmtcap01 intmtcap00 match detection ? match detection ? match detection ? match de t ec tio n ? mt0igic r ? ? figure 10-3 igbt mode block diagram
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 42 / 87 - 10.6.1 prescaler there is a 4-bit prescaler to generate the source clock for up-counter mtuc0. the prescaler input clock t0 is fperiph, fperiph/2, fperiph/4, fper iph/8, fperiph/16 or fperiph/32 selected by cgsyscr in the cg. the peripheral clock, fperiph, is either fgear, a clock selected by cgsyscr in the cg, or fc , which is a clock before it is divided by the clock gear. the operation or the stop of a prescaler is set with mt0run where writing ?1? starts counting and writing ?0? clears and stops counting. table 10-6 shows prescaler output clock re solut i ons.
tmpm380/m382 tmpm380/m382 - 43 / 87 - table 10-6 prescaler output clock resolutions at fc = 40mhz prescaler output clock resolution ? clear peripheral clock ? clock gear value ? prescaler clock selection ? ? ?? ? ?? 000(fperiph/1) fc(0.025 s) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) 001(fperiph/2) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 010(fperiph/4) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 011(fperiph/8) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 100(fperiph/16) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 000 (fc) 101(fperiph/32) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 000(fperiph/1) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 100(fc/2) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) fc/2 9 (12.8 s) 000(fperiph/1) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 001(fperiph/2) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 010(fperiph/4) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 011(fperiph/8) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 100(fperiph/16) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) fc/2 9 (12.8 s) 101(fc/4) 101(fperiph/32) fc/2 7 (3.2 s) fc/2 8 (6.4 s) fc/2 9 (12.8 s) fc/2 10 (25.6 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 011(fperiph/8) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) fc/2 9 (12.8 s) 100(fperiph/16) fc/2 7 (3.2 s) fc/2 8 (6.4 s) fc/2 9 (12.8 s) fc/2 10 (25.6 s) 0 (fgear) 110(fc/8) 101(fperiph/32) fc/2 8 (6.4 s) fc/2 9 (12.8 s) fc/2 10 (25.6 s) fc/2 11 (51.2 s) 000(fperiph/1) fc(0.025 s) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) 001(fperiph/2) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 010(fperiph/4) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 011(fperiph/8) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 100(fperiph/16) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 000 (fc) 101(fperiph/32) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 000(fperiph/1) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) 001(fperiph/2) fc/2 1 (0.05 s) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 010(fperiph/4) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 011(fperiph/8) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 100(fperiph/16) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 100(fc/2) 101(fperiph/32) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 000(fperiph/1) fc/2 2 (0.1 s) fc/2 3 (0.2 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 010(fperiph/4) fc/2 2 (0.1 s) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 011(fperiph/8) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 100(fperiph/16) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 101(fc/4) 101(fperiph/32) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s) 000(fperiph/1) fc/2 3 (0.2 s) 001(fperiph/2) fc/2 3 (0.2 s) fc/2 4 (0.4 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) 011(fperiph/8) fc/2 3 (0.2 s) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) 100(fperiph/16) fc/2 4 (0.4 s) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) 1 (fc) 110(fc/8) 101(fperiph/32) fc/2 5 (0.8 s) fc/2 6 (1.6 s) fc/2 7 (3.2 s) fc/2 8 (6.4 s)
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 44 / 87 - (note 1) the prescaler output clock tn must be selected as tn? fsys. ( tn is slower than fsys). (note 2) do not change the clock gear while the timer is operating. (note 3) ? ? ? denotes a setting prohibited.
tmpm380/m382 tmpm380/m382 - 45 / 87 - ? 10.6.3 up-counter (mtuc0) mtuc0 is a 16-bit binary counter. source clock mtuc0 source clock, specified by mt0igcr< igclk1:0>, can be selected from either four types t0, t 1, t2 and t4 of prescaler output clock. count start/ stop counter operation is specified by mt0 run. mtuc0 starts counting if = ?1?, and stops counting and cl ears counter value if = ?0?. also, counter is cleared if mt0igresta = ?1?, and then restarts count-up from 0. timing to clear the count 1) when a comparing is matched. when the comparator detects a match bet ween up-counter value and a value set in mt0igrg4, counter is cleared. 2) when counter stops by setting mt0run=?0?, c ounter stops and is cleared. 3) when counter restart by setting mt0igresta=?1?, counter is cleared and starts counting up from ?0?. 4) when trigger start mode is set. in the trigger start mode, by setting mt0in pin is driven to the specified stop level, counter stops and is cleared. count up and count clear operation here is the description of count and clear operation and period setup both when source clock  t0 is selected and when source clock t1, t2 or  t4 is selected. 1) when source clock  t0 is selected ? when source clock  t0 is selected, two source clocks are required for the match count and the clear count. thus a value of the period setup is set to m 1. figure 10-4 count-up/ count clearing when source clock  t0 is selected.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 46 / 87 - 2) other than source clock  t0 is selected when source clock  t1, t2 or  t4 is selected, one source clock is required for the match count and the clear count. thus a value of period setup is set to m. figure 10-5 count-up/ count clearing when source clock t1,  t2 or  t4 is selected. 10.6.4 period setup register (mt0igrg4) period setup register is a double-buffered confi guration register which sets ppg output periods. if the mt0igr4 matches with up-counter (mtuc0), counter is cleared and data is updated on next period. at this timing, data is transferred to ti mer register (mt0igrg4) from register buffer 4. ? 10.6.5 timer registers (mt0rg0, mt0rg1, mt0igrg2, mt0igrg3) timer registers are registers for setting values to compare with up-counter values. if the comparator detects a match between a values set in these timer registers, it outputs a match detection signal. timer registers (mt0rg0, mt0rg1, mt0igrg2, mt0igrg3) are the double-buffered configuration and are paired of register buffer. if mt0igrg4 matches with up-counter (mtuc0), counter is cl eared at the same time data is updated. at this time, data is transferred to timer register (mt0igrg2 or 3) from register buffer 2 or 3. in the igbt mode, mt0rg0 and 1 are always doubled-buffered configuration. write and read operation of timer register (mt0rg0, mt0rg1, mt0igr2, mt0igrg3) and period setup register (mt0igrg4) 1) when timer registers and period setup register are written when timer is stopping, data can be written into timer register (mt0rg0, mt0rg1, mt0igrg2, mt0igrg3) and period setup register (mt0igrg4). when timer is in operation, data is latched in each register buffer. if mt0igrg4 matches with up-counter (mtuc0), counter is cleared at the same time data is updated. 2) when timer registers and period setup register are read current value of 16-bit comparator and the ta rget register for comparison to be read. a value of register buffer cannot be read. note) write to this register by unit of 16 bits or 32 bits. writing in unit of 8 bits is prohibited.
tmpm380/m382 tmpm380/m382 - 47 / 87 - 10.6.6 capture control by setting to command start mode or trigger c apture mode, up-counter values (mtuc0) are captured by mt0cp0 and mt0cp1 at the rising edge and falling edge of mt0in pin respectively. 10.6.7 capture registers (mt0cap0, mt0cap1) these are registers for latching values from the up-counter (mtuc0). 10.6.8 comparators (cp0, cp1, cp2, cp3, cp4) these are comparators for detecting a match by comparing set values of the mtuc0 up-counter with set values of the timer regi sters (mt0rg0, mt0rg1, mt0igrg2, mt0igrg3 and mt0igrg4) to detect a match. 10.6.9 output signal control (mtout00, mtout01) output signal control signals (mtout00, mtout 01) are changing by a match detect signal between up-counter and timer register. the init ial mode setting of output control signals are specified with mt0igocr. after reset, these signals are set to ?low? (mt0igocr=0). if mt0igoc r is set to ?0?, t he initial state is ?low?. if mt0igocr is set to ?1 ?, the initial state is ?high?. output control signals are specified with mt 0igocr. after reset, these signals are disabled. when using these si gnals, set mt0igocr=1. 10.6.10 capture interrupt (intmtcap00, intmtcap01) interrupts intmtcap00 and intmtcap01 can be ge nerated at the timing of latching values from the mtuc0 up-counter into the mt0cp0 and mt0cp1 capture registers. the interrupt setting is specified with a register of cpu.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 48 / 87 - 10.6.11 trigger start interrupt (intmttb01) in the case that the command start and trigger start mode, or the trigger start mode is selected, a trigger start interrupt occurs when the counte r starts upon the detection of a trigger edge specified with mtnigcr. in the tr igger capture mode, trigger edge detection does not cause an interrupt. a start trigger causes an interrupt even when the counter is stopped in emergency. figure 10-6 trigger start interrupt operation 10.6.12 period setup interrupt (intmttb00) in the case that command start and trigger capture mode, or command start and trigger start mode is selected, a period interrupt (intmttb00) occurs when the counter starts with a command start and when the counter is cleared wi th the specified counter period (mtnigreg4) reached at the end of specified period. a match with the set period causes an interrupt even when the counter is stopped in emergency. the interrupt periods are selected as every 1-period, 2-period and 4-period specifi ed with mtnigcr. figure 10-7 period setup interrupt operation an interrupt generation at the start counting is prohibited or permitted with command start interrupt control register mt0igcr. when a command starts specified with mt0rn setting to 1? and mt0in pin is stop level, the counter does not start (intmttb00 is not generated). a subsequent trigge r start edge causes the counter to start and intmttb01 occurs. mtnigcr specifies whether the first intmttb00 occurs.
tmpm380/m382 tmpm380/m382 - 49 / 87 - 10.6.13 basic operation to start timer after setting mt0rg0, 1 and mt0igrg2 to mt0igrg4, ppg pulses are outputted to mtout00 pin and mtout10 pin. mt0rg0 mt0rg1 mt0igrg2 mt0igrg3 mt0igrg4 mtout00 mtout10 value of mt0igrg4 0 counter value (mtuc0) mt0rg0 mt0rg1 mt0igrg2 mt0igrg3 mt0igrg4 intmttb00 m m? n n? s s? t t? u u? match with figure 10-8 basic timing of igbt function
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 50 / 87 - 10.6.14 how to start igbt timer igbt modes are selected among three starting modes. 10.6.14.1 command start and trigger capture mode writing ?1? to mt0run causes the current count to be cleared and the counter to start counting. once the count has reached a specif ied period, the counter is cleared. the counter subsequently restarts counting if specifies continuous mode (mt0igcr =0) it stops counting if specifies one-time mode (mt0igcr=1). writing ?1? to mt0igresta before the count reaches a period causes the counter to be cleared, after which it operates as specified with . the count values at the rising and falling edges on the mt0in pin can be stored in capture registers. figure 10-9 operation in command start when the counter starts in the command start and trigger capture mode, counter values of mtnin input both at the rising edge and falling edge are captured by the mtncpa0 and mtncap1 capture register respectively. when the valu es are captured, intmtcapn0 and intmtcapn1 generate respectively. mtnin mt0igr 0 counter value (mtuc0) intmcapn0 aa bb mtncap1 mtncap0 00 cc 00 dd intmcapn1 intmttbn0 ? figure 10-10 operation in capture 5?? ? ? ?(473,e ? ppg output with a period specified with mtig0rg4 count start by command count clear start count clear restart count clear =1 ppg output with a period specified with mtig0rg4 ppg output with a period specified with mtig0rg4 mtout00/10 (example)
tmpm380/m382 tmpm380/m382 - 51 / 87 - 10.6.14.2 command start and trigger start mode writing a 1 to mt0run causes the curr ent count to be cleared and the counter to start counting. the operation is the same as that in command start and capture mode if there is no trigger input on the mt0in pin. if an edge specifie d with the start edge selection field (mt0igicr ? ) appears on the mt0in pin, however, the timer starts counting. the counter is cleared and stopped while the mt0in pin is driven to the specified clear/stop level. if the mt0in pin is at the clear/stop level when a count start comma nd is issued (1 is written to mt0run ), counting does not start (intmttb00 does not occur) until a trigger start edge appears, causing intmttb01 to occur (a trigger input takes precedence over a command start). note: for more information on the acceptance of a trigger, see ?trigger start/stop acceptance mode?. figure 10-11 operation in command start and trigger start mode period (mt0igrg4) no trigger, same as trigger capture mode. =1 (start by rising edge) count stopped count start by command count clear re-start count clear count clear re-start count stop by falling edge count start by rising edge mt0in (signal after noise eliminated) mtout00/10 (example)
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 52 / 87 - 10.6.14.3 trigger start mode if an edge specified with the start edge selection field (mt0igicr) appears on the mt0in pin, the timer starts counting. the counter is cleared and stopped while the mt0in pin is driven to the specified clear/stop level. in trigger start mode, writing a 1 to mt0run is ignored and does not initialize the mpt0out0/1 outputs. note: for more information on the acceptance of a trigger, see ?trigger start/stop acceptance mode?. figure 10-12 operation in trigger start mode mtout00/10 (example) mt0in (signal after noise eliminated) mtout00/10 (example) command issue after a command is issued, counting does not start until a specified trigger appears command issue count start count stopped count start count start count clear count clear count clear count start count stopped count stopped after a command is issued, counting does not start until a specified trigger appears mt0in (signal after noise eliminated)
tmpm380/m382 tmpm380/m382 - 53 / 87 - 10.6.15 one-time / continuous output mode the igbt output can be set to either one -time output mode or continuous output mode. 10.6.15.1 continuous output mode setting the timer (mt0igcr = ?0?) when the timer starts (mt0run = ?1?) specifies the continuous output mode. in this mode, the timer continuously outputs specified waveforms. 10.6.15.2 one-time output mode setting the timer (mt0igcr =?1?) when the timer starts (mt0run = ?1?) specifies the one-time output mode. in this mode, the timer stops the counter at the end of a single period. for a trigger start, the counter stops until a trigger is detected. a specified trigger starts counting and the counter stops at the end of a single peri od. set ?1? to mtnrun to restart the counter using a trigger.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 54 / 87 - 10.6.16 configuring how the timer stops setting mt0run to 0 causes the timer to stop with the specified output state according to the setting of mt0igocr. 10.6.16.1 counting stopped with outputs initialized when mt0igocr is set to ?00?, the counter stops immediately with the mtout00 and mtout10 outputs initialized values sp ecified with mt0igocr. figure 10-13 immediately stopping and clearing the counter with the outputs initialized (=00) 10.6.16.2 counting stopped with outputs maintained when mt0igocr is set to ?01?, the count er stops immediately with the current mtout00 and mtout10 output states maintained. to restart the counter from the maintai ned state (mt0igocr=01), set mt0run to ?1?. the counter is restarted with the initial output values, specified with mt0igocr . figure 10-14 immediately stopping and clearing the counter with the outputs maintained (=01) mtout00 =0 mtout10 =1 enable output =11 start counting =1 =00 stop counting =0 counting stopped and output is initialized mtout00 =0 mtout10 =1 enable output =11 start counting =1 =01 stop counting =0 counting stopped and output is maintained
tmpm380/m382 tmpm380/m382 - 55 / 87 - 10.6.16.3 counting stopped with outputs initialized at the end of the period when mt0igocr is set to ?10?, the counter continues counting until the end of the current period and then stops. if a stop trigger is detected before the end of the period, however, the counter stops immediately. registers except mt0igocr must not be rewri tten before the counter stops completely. mt0igst can be read to determine whether the counter has stopped. note that before changing the timer settings, conf irm the counter stopped after period completed. figure 10-15 stopping the counter at the end of the period (=10) mtout00 =0 mtout10 =1 enable output =11 start counting =1 =10 stop command =0 continue counting until the end of period. after counting stopped, output is initialized stop counting period period ?
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 56 / 87 - 10.6.17 trigger input 10.6.17.1 selecting an input signal logic the logic for an input trigger signal on the mt0in pin can be specified using ? mt0igicr. ? igtrgsel = ?0?: counting starts on the rising edge. the counter is cleared and stopped while the mt0in pin is low. ? igtrgsel =? 1?: counting starts on the falling edge. the count er is cleared and stopped while the mt0in pin is high. figure 10-16 trigger input signal in one-time stop mode, the counter accepts a st op trigger but does not accept a start trigger (when a stop trigger is accepted within a period, the output is immediately initialized and the counter is stopped). figure 10-17 trigger accepted in stop counter after completing output in the current period all triggers (start and stop) are ignored when the timer is stopped (m t0run = ?0?). mt0in pin mt0in pin igtrgsel=?1? igtrgsel=?0? mt0in pin mtout00/10
tmpm380/m382 tmpm380/m382 - 57 / 87 - 10.6.17.2 specifying whether trigger are always accepted or ignored w hen mtout00/10 outputs are active the mt0igicr specifies whether triggers from the mt0in pin are always accepted or ignored when the ppg output is active. ? igtrgm = ?0?: triggers from the mt0in pin are always accepted regardless of whether mtout00 and mtout10 outputs are active or inactive. a tr igger starts or clears/stops the timer and deactivates mtout00 and mtout10 outputs. figure 10-18 start trigger on the mt0in pin ? igtrgm = ?1?: triggers from the mt0in pin are accepted only when mtout00 and mtout10 outputs are inactive. a trigger starts or clears/stops the timer. triggers are ignored when mtout00 and mtout10 outputs are active. the active/inactive state of the mtout00 an d mtout10 pins has meaning only when output on the pin is enabled with or . mt0in mtout00 (positive) mtout10 (positive) intmtttb01 intmtptb00 ( si gna l a f te r noise eliminated)
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 58 / 87 - figure 10-19 trigger start mt0in mtout00 (positive) mtout10 (positive) intmttb01 intmttb00 mtout00 and mtout10 are mtout00 or mtout10 is active mtout00 or mtout10 is active mtout00 and mtout10 becomes inactive ( si gna l a f te r noise eliminated)
tmpm380/m382 tmpm380/m382 - 59 / 87 - 10.6.18 noise canceller a signal from external input pin (mtnin, gemgn) is eliminated noise by digital noise canceller. digital noise canceller can be selected noise e liminating time with mtnigigr and mtnigemgcr. 10.6.19 emergency stop function 10.6.19.1 operating description when mtnigemgcr is set to ?1?, the emergency stop function is permitted, that is, gemgn input is permitted. when a low level input is detected with gemgn pin, mtout0n and mtout1n waveform are initialized or become hi-z state, and the gemgn inte rrupt occurs specified with mtngemgcr setting. note that this function is only prohibited the mtout0n and mtout1n outputs not the counter stopping thus timer must be stopped in the interrupt routine. 10.6.19.2 emergency stop monitoring when the emergency output stop feature activates, the mtnigemgst is set to ?1?. if ?0? is read from igemgst, it indicates that the emergency output stop is enabled. 10.6.19.3 gemg interrupt a gemg interrupt (intmtengn) occurs when an emergency output stop input is accepted. to use a gemg interrupt (intmtengn) for some processing, ensure that the interrupt is permitted beforehand. when gemgn pin is low, an attempt to cancel the emergency output stop state results in an interrupt being generated again, with t he emergency output stop state reestablished. 10.6.19.4 cancelling the emergency output stop state to cancel the emergency output stop state, perform the following steps: 1. confirm gemgn pin is high 2. set mtnrun to ?0?. 3. confirm the timer operation stopped (mtnigst=0) after confirming above steps, by setting to mtnigemgcr to ?1?, the emergency output stop state is released.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 60 / 87 - 10.7 description of operations for pmd mode (pmd: programmable motor driver) the mpt has programmable motor driver (pmd) module. the pmd supports interaction with the ad converter. cpu io bus i/f conduction output uo0,vo0,wo0, xo0,yo0,zo 0 analog input motor current, motor voltage adc emg detection input /emg0 mpt0(pmd mode) c onduction output uo1,vo1,wo1, xo1,yo1,zo1 mpt1(pmd mode) interrupt intpmd0 interrupt intpmd1 interrupt intadpd0/1 intadcp0/1 intadsft intadtmr trigger for ad c pmdtrg0/1 trigger for ad c pmdtrg2/3 trigger signal pmdtrg2/3 emg detection input /emg 1 trigger signal pmdtrg0/1 fig 10-1 motor control-related block constitution
tmpm380/m382 tmpm380/m382 - 61 / 87 - 10.7.1 pmd input/ output signals the table 10-4 shows the signals that are input to and output from each pmd (mpt). table 10-7 input/ output signals channel pin name pmd signal name description pc6/emg0 emg0 emg state signal pc0/uo0 u0 u-phase output pc1/xo0 x0 x-phase output pc2/vo0 v0 v-phase output pc3/yo0 y0 y- phase output pc4/wo0 w0 w-phase output ch 0 pc5/zo0 z0 z-phase output pg6/emg1 emg1 emg state signal pg0/uo1 u1 u-phase output pg1/xo1 x1 x-phase output pg2/vo1 v1 v-phase output pg3/yo1 y1 y-phase output pg4/wo1 w1 w-phase output ch 1 pg5/zo1 z1 z-phase output
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 62 / 87 - 10.7.2 pmd registers table 10-8 shows a list of pmd register. (upper case: pmd0, lower case: pmd1) table 10-1 ? list of pmd register address register symbols register names 0x4005 0400 0x4005 0480 mtpd0mden mtpd1mden pmd enable register 0x4005 0404 0x4005 0484 mtpd0portmd mtpd1portmd port output mode control register 0x4005 0408 0x4005 0488 mtpd0mdcr mtpd1mdcr pmd control register 0x4005 040c 0x4005 048c mtpd0cntsta mtpd1cntsta pwm counter status register 0x4005 0410 0x4005 0490 mtpd0mdcnt mtpd1mdcnt pwm counter register 0x4005 0414 0x4005 0494 mtpd0mdprd mtpd1mdprd pwm period register 0x4005 0418 0x4005 0498 mtpd0cmpu mtpd1cmpu pmd compare u register 0x4005 041c 0x4005 049c mtpd0cmpv mtpd1cmpv pmd compare v register 0x4005 0420 0x4005 04a0 mtpd0cmpw mtpd1cmpw pmd compare w register 0x4005 0424 0x4005 04a4 reserved 0x4005 0428 0x4005 04a8 mtpd0mdout mtpd1mdout pmd output control register 0x4005 042c 0x4005 04ac mtpd0mdpot mtpd1mdpot pmd output setting register 0x4005 0430 0x4005 04b0 mtpd0emgrel mtpd1emgrel emg release register 0x4005 0434 0x4005 04b4 mtpd0emgcr mtpd1emgcr emg control register 0x4005 0438 0x4005 04b8 mtpd0emgsta mtpd1emgsta emg status register 0x4005 043c 0x4005 04bc reserved - 0x4005 0440 0x4005 04c0 reserved - 0x4005 0444 0x4005 04c4 mtpd0dtr mtpd1dtr dead time register 0x4005 0448 0x4005 04c8 mtpd0trgcmp0 mtpd1trgcmp0 trigger compare 0 register 0x4005 044c 0x4005 04cc mtpd0trgcmp1 mtpd1trgcmp1 trigger compare 1 register 0x4005 0450 0x4005 04d0 reserved - 0x4005 0454 0x4005 04d4 reserved - 0x4005 0458 0x4005 04d8 mtpd0trgcr mtpd1trgcr trigger control register 0x4005 045c 0x4005 04dc mtpd0trgmd mtpd1trgmd trigger output mode setting register 0x4005 0460 0x4005 04e0 reserved - 0x4005 047c 0x4005 04fc reserved -
tmpm380/m382 tmpm380/m382 - 63 / 87 - 10.7.3 pmd module pulse width modulation conduction control protection control dead time contr ol mtpd n md pr d mtpdncmpu mtpd n c mpv mtpd n c mpw mtpdnmdcr mtpdnmdout uon xon von yon won zon mtpd n emgc r mtpd n d tr mtpd n emgr el intpmdn pw mb.0 pw mb.1 pw mb.2 pw mb.3 pw mb.4 pw mb.5 u x v y w z poutu poutv poutw upequs dnequs sync trigger generation mtpdntrgcmp0 mtpdntrgcmp1 pmdtrg0 pmdtrg1 ptenc mdcnt intemgn portenn emgn mtpd n md pot wave generation circuit sync trigger generation circuit (n=0,1) fig 10-2 block diagram of pmd module the pmd module consists of two blocks of a wave generation circuit and a sync trigger generation circuit. the wave generation circuit includes a pulse width modulation circuit, a conduction control circuit, a protection control circuit, a dead time control circuit. - the pulse width modulation circuit generates independent 3-phase pwm waveforms with the same pwm frequency. - the conduction control circuit determines the output pattern for each of the upper and lower sides of the u, v and w phases. - the protection control circuit contro ls emergency output stop by emg input. - the dead time control circuit prevents a short circuit which may occur when the upper side and lower side are switched. - the sync trigger generation circuit generates sync trigger signals to the ad converter.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 64 / 87 - ? pmd enable register (mtpdnmden) 0x4005 0400, 0x4005 0480 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - - - - pwmen read/write r 0 r0 r0 r0 r0 r0 r0 r/w after reset 0 0 0 0 0 0 0 0 : enables or disables waveform synthesis. 0: disable 1: enable output ports that are used for the pmd beco me high impedance when the pmd is disabled. before enabling the pmd, configure other relev ant settings, such as output port polarity. ? port output mode register (mtpdnportmd) 0x4005 0404, 0x4005 0484 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - - - - portmd read/write r 0 r0 r0 r0 r0 r 0 r/w r/w after reset 0 0 0 0 0 0 0 0 : port control setting 0: upper phases = high-z 1: upper phases = pmd output the setting controls external port outputs of the upper phases (u, v and w phases) and the lower phases (x, y and z phases). when a tool break occurs while ?high-z? is selected, the upper and lower phases of external output ports are set to high impedance. in other cases, external port outputs depend on pmd outputs. * when pwmen=0, output ports are set to high im pedance regardless of the output port setting. * when an emg input occurs, external port output s are controlled depending on the mtpdnemgmd setting. : must be write ?0?
tmpm380/m382 tmpm380/m382 - 65 / 87 - 10.7.3.1 pulse width modulation circuit pwm control pwm sync clock upequs,dnequs pwmu pwmv pwmw interrupt request intpmdn mtpdnmdcr bufferu bufferv bufferw mtpdnmdprd mtpdncmpu mtpdncmpv mtpdncmp w selector/latch selector 0x0001 4 mtpdnmdcnt up/down pwm counter register pwm period register pmd compare register pwm counter a b a ? b a ? b a ? b mdcnt cmprld mtpdncntsta pwm counter status register fsys clock control pmd control register fig 10-3 pulse width modulation circuit the pulse width modulation circuit has a 16-bit pmd up-/down-counter and generates pwm carrier waveforms with a resolution of 25 ns at 40 mhz. the pwm carrier waveform mode can be selected from mode 0 (edge-aligned pwm, sawtooth wave modulation) and mode 1 (center-aligned pwm, triangular wa ve modulation). the pwm period extension mode (mtpdnmdcr = 1) is also available. when this mode is selected, the pwm counter generates pwm ca rrier waveforms with a resolution of 100 ns.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 66 / 87 - (1) setting the pwm period the pwm period is determined by the mtpdnmdprd register. this register is double-buffered. comparator input is updated at every pwm period. it is also possible to update comparator input at every half pwm period. oscillation frequency [hz] sawtooth wave pwm: mtpdnmdprd register value = pwm frequency [hz] oscillation frequency [hz] triangular wave pwm: mtpdnmdprd register value = pwm frequency [hz] 2 (2) compare function the pulse width modulation circuit compares the pwm compare registers of the 3 phases (mtpdncmpu, mtpdncmpv, mtpdncmpw) and the carrier wave generated by the pwm counter (mtpdnmdcnt) to determine which is larger to generate pwm waveforms with the desired duty. the pwm compare register of each phase has a double-buffered compare register. the pwm compare register value is loaded at every pwm per iod (when the internal counter value matches the mtpdnmdprd value). it is also possible to update th e compare register at every 0.5 pwm periods. sawtooth wave [triangular wave] " mtpdnmdprd ] mdcnt time [mtpdncmpu ] on off pwmu waveform mdcnt time on off pwmu waveform mtpdnmdcnt counts up to mtpdnmdprd and is cleared to 1 in the next cycle. when switching from counting down to counting up, mtpdnmdcnt=peak value (mdprd) in two cycles . when switching from counting down to counting up, mtpdnmdcnt=1 in two cycles. ? " mtpdnmdprd $ " mtpdncmpu $ fig 10-4 pwm waveforms
tmpm380/m382 tmpm380/m382 - 67 / 87 - (3) waveform mode 3-phase pwm waveforms can be generated in the following two modes: i) 3-phase independent mode: each of the pwm compare registers for the three phases is set independently to generate independent pwm waveforms for each phase. this mode is used to generate drive waveforms such as sinusoidal waves. ii) 3-phase common mode: only the u-phase pwm compare register is set to generate identical pwm waveforms for all the three phases. this mode is used for rectangul ar wave drive of brushless dc motors. (4) interrupt processing the pulse width modulation circuit generates pwm interrupt requests in synchronization with pwm waveforms. the pwm interrupt period can be set to half a pwm period, one pwm period, two pwm periods or four pwm periods.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 68 / 87 - ? pmd control register ( mtpdn mdcr) 0x4005 0408, 0x4005 0488 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - pwmck syntmd dtymd pint intprd pwmmd read/write r 0 r/w after reset 0 0 0 0 0 0 0 0 : pwm carrier waveform 0: pwm mode 0 (edge-aligned pwm, sawtooth wave) 1: pwm mode 1(center-aligned pwm, triangular wave) this bit selects the pwm mode. pwm mode 0 is edge-aligned pwm and pwm mode 1 is center-aligned pwm. : pwm interrupt period 00: interrupt request at every 0.5 pwm period (pwm mode 1 only) 01: interrupt request at every pwm period 10: interrupt request at every 2 pwm periods 11: interrupt request at every 4 pwm periods this field selects the pwm interrupt period from 0.5 pwm period, one pwm period, two pwm periods and four pwm periods. when =00, the contents of the compare registers (mtpdncmpu, mtpdncmpv, mtpdnvcmpw) and period register (mtpdnmdprd) are updated into their respective buffers when the internal counter equals 1 or the mtpdnmdprd value. : pwm interrupt timing 0: interrupt request when pwm counter = 1 1: interrupt request when pwm counter = mtpdnmdprd this bit selects whether to generate an inte rrupt request when the pwm counter equals its minimum or maximum value. when the edge-aligned pwm mode is selected, an interrupt request is generated when the pwm counter equals the mtpdnmdprd val ue. when the pwm interrupt period is set to every 0.5 pwm period, an interrupt request is generated when the pwm counter equals 1 or mtpdnmdprd.) : duty mode 0: 3-phase common mode 1: 3-phase independent mode this bit selects whether to make duty setting independently for each phase or to use the cmpu register for all three phases. : port output mode this bit specifies the port output setting of the u, v and w phases. (see table 10-8 ) : pwm pe riod extension mode 0: normal period 1: 4x periods when =0, the pwm counter operates with a resolution of 25 ns at fsys=40 mhz. * sawtooth wave: 25ns, triangular wave: 50 ns when =1, the pwm counter operates with a resolution of 100 ns at fsys=40 mhz.
tmpm380/m382 tmpm380/m382 - 69 / 87 - * sawtooth wave: 100 ns, triangular wave: 200 ns
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 70 / 87 - ? pwm counter status register (m tpdn cntsta) 0x4005 040c, 0x4005 048c 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - - - - updwn read/write r 0 r0 r0 r0 r0 r0 r0 r after reset 0 0 0 0 0 0 0 0 : pwm counter flag 0: up-counting 1: down-counting this bit indicates whether the pwm c ounter is up-counting or down-counting. when the edge-aligned pwm mode is select ed, this bit is always read as 0. ? pwm counter register (m tpdn mdcnt) 0x4005 0410, 0x4005 0490 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol mdcnt read/write r after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol mdcnt read/write r after reset 0 0 0 0 0 0 0 1 : pwm counter pmd counter value (resolution: 25 ns at fsys = 40 mhz) * sawtooth wave: 25 ns, triangular wave: 50 ns * when mtpdnmdcr=1, the counter resolution becomes 100 ns. a16-bit counter for reading the pwm period count value. it is read-only.
tmpm380/m382 tmpm380/m382 - 71 / 87 - ? pwm period register (m tpdn mdprd) 0x4005 0414, 0x4005 0494 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol mdprd read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol mdprd read/write r/w after reset 0 0 0 0 0 0 0 0 : pwm period mdprd R 0x0010 a 16-bit register for specifying the pwm period. this register is double-buffered and can be changed even when the pwm counter is operating. the buffer is loaded at every pwm period. (that is, when the pwm counter matches the mdprd value. wh en 0.5 pwm period is selected, loading is performed when the pwm counter matches 1 or mdprd. the least significant bit must be set as 0.) if is set to a value less than 0x0010, it is automatically assumed to be 0x0010. (the register retains the actual value that is written.) * do not write to this register in byte units. if the upper 8 bits [15:8] and the lower 8 bits [7:0] are written separately, operation cannot be guaranteed.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 72 / 87 - ? pwm compare registers (m tpdn cmpu, m tpdn cmpv, m tpdn cmpw) mpt01(0x4005 0418-041b),mpt12( 0x4005 0498-049b) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol cmpu0,1 read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol cmpu0,1 read/write r/w after reset 0 0 0 0 0 0 0 0 mpt0(0x4005 041c-041f),mpt1( 0x4005 049c-049f) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol cmpv0,1 read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol cmpv0,1 read/write r/w after reset 0 0 0 0 0 0 0 0 mpt0(0x4005 0420-0423),mpt1( 0x4005 04a0-04a3) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol cmpw0,1 read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol cmpw0,1 read/write r/w after reset 0 0 0 0 0 0 0 0
tmpm380/m382 tmpm380/m382 - 73 / 87 - : pwm pulse width compare registers (resolution: 25 ns at fsys =40 mhz) * sawtooth wave: 25 ns, triangular wave: 50 ns * when mtpdnmdcr=1, the counter resolution becomes 100 ns. cmpu, cmpv and cmpw are compare registers for determining the output pulse width of the u, v and w phases. theses registers are double-buffered. pulse width is determined by comparing the buffer and the pwm counter to evaluate which is larger. (to be loaded when the pwm counter value matches the mdprd value. when 0.5 pwm period is selected, loading is performed when the pwm counter matches 1 or mdprd.) when this register is r ead, the value of the first buffer (data set via the bus) is returned. * do not write to these registers in byte units. if the upper 8 bits [15:8] and the lower 8 bits [7:0] are written separately, operation cannot be guaranteed.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 74 / 87 - 10.7.3.2 conduction control circuit decoder decoder decoder upwm uoc mux vpwm voc wpwm woc pwmu pwmv pwmw ff ff ff dtymd 0 1 xpwm outd pwmin pwmin x mddec ff rel ff ff ff u v w x y z mtpdnmdout mtpdnmdcr sync fig 10-5 conduction control circuit the conduction control circuit performs output port control according to the settings made in the pmd output register (mtpdnmdout). the mdout register bi ts are divided into two parts: settings for the synchronizing signal for port output and settings for port output. the latter part is double-buffered and update timing can be set as synchronous or asynchronous to pwm. the output settings for six port lines are made independently for each of the upper and lower phases through the bits 10 to 8 of the mdout register and bi ts 3 and 2 of the mtpdnmdpot register. in addition, bits 10 to 8 of the mtpdnmdout register select pwm or h/l output for each of the u, v and w phases. when pwm output is selected, pwm waveforms are outpu t. when h/l output is selected, output is fixed to either a high or low level. table 10-8 sho w s a sum mary of port outputs according to port output settings in the mtpdnmdout register and polarity settings in the mtpdnmdcr register.
tmpm380/m382 tmpm380/m382 - 75 / 87 - ? pmd output setting register (mtpdnmdpot) 0x4005 042c, 0x4005 04ac 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - polh poll psyncs read/write r 0 r0 r0 r 0 r/w r/w r/w after reset 0 0 0 0 0 0 0 0 : mdout transfer timing 00: async to pwm 01: load when pwm counter = 1 10: load when pwm counter= mdprd 11: load when pwm counter = 1 or mdprd psyncs selects the timing when the u-, v- and w-phase output settings are reflected in port outputs (sync or async to the pwm counter peak, bottom or peak/bottom). * this field must be set while mtpdnmden=0. : lower phase port polarity 0: active low 1: active high poll selects the output port polarity of the lower phases. * this bit must be set while mtpdnmden=0. : upper phase port polarity 0: active low 1: active high polh selects the output port polarity of the upper phases. * this bit must be set while mtpdnmden=0.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 76 / 87 - ? pmd output control register (mtpdnmdout) 0x4005 0428, 0x4005 04a8 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - wpwm vpwm upwm read/write r 0 r0 r0 r0 r 0 r/w r/w r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - woc voc uoc read/write r 0 r 0 r/w r/w r/w after reset 0 0 0 0 0 0 0 0 ,: u-, v-, and w-phase output control the mtpdnmdout register controls t he port outputs of the u, v and w phases (see table 10-8 belo w .) * to load the second buffer of mtpdnmdout with a value updated via the bus, select the bus mode (default) by setting mtpdnmodesel to 0. * do not write to this register in byte units . if the upper 8 bits [15:8] and the lower 8 bits [7:0] are written separately, operation cannot be guaranteed. table 10-8 port outputs according to the uoc, voc, woc, upwm, vpwm and wpwm settings mtpdnmdcr=0 polarity: active high (mdpot bits 3, 2=1) polarity: active low (mdpot bits 3, 2=0) mdout output control mdout bits 10, 9, 8 h/l or pwm output select mdout output control mdout bits 10, 9, 8 h/l or pwm output select 0: h/l output 1: pwm output 0: h/l output 1: pwm output bits 5, 3, 1 upper phase bits 4, 2, 0 lower phase upper phase output lower phase output upper phase output lower phase output bits 5,3,1 upper phase bits 4,2,0 lower phase upper phase output lower phase output upper phase output lower phase output 0 0 l l /pwm pwm 0 0 h h pwm /pwm 0 1 l h l pwm 0 1 h l h /pwm 1 0 h l pwm l 1 0 l h /pwm h 1 1 h h pwm /pwm 1 1 l l /pwm pwm mtpdnmdcr=1 polarity: active high (mdpot bits 3, 2=1) polarity: active low (mdpot bits 3, 2=0) mdout output control mdout bits 10, 9, 8 h/l or pwm output select mdout output control mdout bits 10, 9, 8 h/l or pwm output select 0: h/l output 1: pwm output 0: h/l output 1: pwm output bits 5, 3, 1 upper phase bits 4, 2, 0 lower phase upper phase output lower phase output upper phase output lower phase output bits 5,3,1 upper phase bits 4,2,0 lower phase upper phase output lower phase output upper phase output lower phase output 0 0 l l /pwm pwm 0 0 h h pwm /pwm 0 1 l h l /pwm 0 1 h l h pwm 1 0 h l pwm l 1 0 l h /pwm h 1 1 h h pwm /pwm 1 1 l l /pwm pwm
tmpm380/m382 tmpm380/m382 - 77 / 87 - output settings for center-off pwm center-off pwm can be supported by the following settings. table 10-9 register settings for center-off pwm normal pwm center on u-phase pwm center off v-phase pwm center off w-phase pwm center off cmpu duty_u mdprd-duty_u duty_u duty_u cmpv duty_v duty_v mdprd-duty_v duty_v cmpw duty_w duty_w duty_w mdprd-duty_w uoc 11 00 11 11 voc 11 11 00 11 woc 11 11 11 00
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 78 / 87 - 10.7.3.3 protection control circuit ? protection control mt pd nemgcr u x v y w z mtpdnemgrel em g intemgn em gs t u? x? v? y? w? z? ? 6 8 emg control regis ter emg release regis ter e mg inpu t e mg interrupt e mg port input enable ptenc pten_n up p e r / l o w er ph as e o u t p u t fig 10-6 protection control circuit the protection control circuit consists of an emg protection control circuit.
tmpm380/m382 tmpm380/m382 - 79 / 87 - (1) emg protection circuit the emg protection circuit consists of an emg protection control unit and a port output disable unit. this circuit is activated when the emg input becomes low. the emg protection circuit offers an emergency stop mechanism: when the emg input is asserted (h l), all six port outputs are immediately disabled (depending on the mtpdnemgcr setting) and an emg interrupt (intemg) is generated. mtpdnemgcr can be set to output a control signal that sets external output ports to high impedance in case of an emergency. a tool break also disables all six pwm output lines depending on the emgcr setting. when a tool break occurs, external output ports can be set to high impedance through the setting of the portmd register. emg protection is set through the emg control re gister (mtpdnemgcr). a read value of 1 in mtpdnemgsta indicates that the emg prot ection circuit is active. in this state, emg protection can be released by setting all the port output lines inactive (mdout[10:8][5:0]) and then setting mtpdnemgcr to 1. to disable the emg protection function, write 0x5a and 0xa5 in this order to the mtpdnemgrel register and then clear mtpdnemgcr to 0. (these three instructions must be executed consecutively.) while the emg protection input is low, any attempt to release the emg protection state is ignored. before setting mtpdnemgcr to 1 to release emg protection, make sure that mtpdnemgst is high. the emg protection circuit can be disabled only after the specified key codes (0x5a, 0xa5) are written in the mtpdnemgrel register to prev ent it from being inadvertently disabled. ? emg release register (mtpdnemgrel) 0x4005 0430, 0x4005 04b0 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol emgrel read/write w after reset 0 0 0 0 0 0 0 0 : emg disable code the emg protection functions can be disabled by setting 5a and a5 in this order to bits 7 to 0 of the mtpdnemgrel register. when disabling these functions, mtpd nemgcr must be cleared to 0. * this register is used for both the emg function.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 80 / 87 - ? emg control register (mtpdnemgcr) 0x4005 0434, 0x4005 04b4 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - emgcnt read/write r 0 r0 r0 r0 r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - inhen emgmd - emgrs emgen read/write r 0 r 0 r/w r/w r/w w r/w after reset 0 0 1 1 1 0 0 1 : emg protection circuit enable/disable 0: disable 1: enable the emg protection circuit is enabled by setting this bi t to 1. in the initial state, the emg protection circuit is enabled. to disable this circuit, write 5a and a5 in this order to the mtpdnemgrel register and then clear the emgen bit to 0. : emg protection release 0: - 1: release protection emg protection can be released by setting the mt pdnmdout register to 0 and then setting the emgrs bit to 1. this bit is always read as 0. * be sure to write 0 to both the upper bits [10:8] and lower bits [5:0]. * before releasing emg protection, make su re that the emg input has returned to high. bit2: write ?0? : emg protection mode select 00: pwm output control disabled / port output = all phases high-z 01: all upper phases on, all lower phases off / port output = lower phases high-z 10: all upper phases off, all lower phases on / port output = upper phases high-z 11: all phases off / port output = all phases high-z * on = pwm output (no output control), off = low [when ,=1 (active high)] this field controls pwm output and port output of the upper and lower phases in case of an emergency. : tool break enable/disable 0: disable 1: enable this bit selects whether or not to stop the pmd wh en the pmd stop signal is input from the tool. in the initial state, tool breaks are enabled. : emg input detection time 0 to 15 (when tmpm380/m382 tmpm380/m382 - 81 / 87 - ? emg status register (mtpdnemgsta) 0x4005 0438, 0x4005 04b8 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r0 r0 r0 r0 r0 r0 r0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - - - emgi emgst read/write r 0 r0 r0 r0 r0 r 0 r r after reset 0 0 0 0 0 0 - 0 : emg protection state 0: normal operation 1: protected the emg protection state can be known by reading this bit. : emg input emg protection state the emg input state can be known by reading this bit.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 82 / 87 - 10.7.3.4 dead time circuit on delay circuit u w mtpdnmdpot u? mtpdnmdpo t on delay circuit on delay circuit w? v? x? y? z? mtpdndtr fsys/8 v x y z fig 10-7 dead time circuit the dead time circuit consists of a dead time unit and an output polarity switching unit. for each of the u, v and w phases, the on delay circuit introduces a delay (dead time) when the upper and lower phases are switched to prevent a short circuit. the dead time is set to the dead time register (dtr) as an 8-bit value with a resolution of 200 ns at 40 mhz. the output polarity switching circuit allows the polarit y (active high or active low) of the upper and lower phases to be independently set through mdpot and . ? dead time register (mtpdndtr) 0x4005 0444, 0x4005 04c4 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol dtr read/write r/w after reset 0 0 0 0 0 0 0 0 : dead time 200 nsec 8 bits (up to 51 s at fsys = 40 mhz) * do not change this register while mtpdnmden=1.
tmpm380/m382 tmpm380/m382 - 83 / 87 - 10.7.3.5 sync trigger generation circuit mtpdn m dcn t mtpdn rgcmp0 trg1 trg0 bu ffe r bu ffe r mt pdn trgcr pwmsync signal slope select a=b updn ptenc a=b trigger output se lect pmdtrg0 pmdtrg1 pmdtrg2 pmd trg3 mt pdn trgcmp1 mtpdn trgmd fig 10-8 sync trigger generation circuit the sync trigger generation circuit generates trigge r signals for starting adc sampling in synchronization with pwm. the adc trigger signal (pmdtrg) is generated by a match between mtpdnmdcnt and mtpdntrgcmp. the signal generation timing can be se lected from up-count match, down-count match and up-/down-count match. when the edge-aligned pwm mode is selected, the adc trigger signal is generated on an up-count match. when pwm output is disabled (mtpdnmden=0), trigger output is also disabled.
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 84 / 87 - ? trigger compare registers (mtpdntrgcmp0, mtpdntrgcmp1) mpt0 (0x4005 0448-044b), mpt 1 (0x4005 04c8-04cb) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol trgcmp0 read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol trgcmp0 read/write r/w after reset 0 0 0 0 0 0 0 0 mpt 0 (0x4005 044c-044f), mpt 1 (0x4005 04cc-04cf) 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol trgcmp1 read/write r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol trgcmp1 read/write r/w after reset 0 0 0 0 0 0 0 0 : trigger output compare registers
tmpm380/m382 tmpm380/m382 - 85 / 87 - when the pmd counter value (mdcnt) matches the value set in mtpdntrgcmpx, pmdtrg is output. when mtpdntrgcmpx is read, the value in the first buffer of the double buffers (data set via the bus) is returned. mtpdntrgcmpx should be set in a range of 1 to [mdprd set value ? 1]. * it is prohibited to set mtpdntrgcmpx to 0 or the mtpdnmdprd value. * to load the data in mtpdntrgcmp0 and mtpdntrgcmp1 to the second buffers, select the bus mode (default) by setting mtpdnmodesel to 0. * do not write to these registers in byte units. if t he upper 8 bits [15:8] and the lower 8 bits [7:0] are written separately, operation cannot be guaranteed. * when mtpdntrgcmpx is set to 0x0001, no trigger output is made only in the first cycle after pwm start (mtpdnmden1). update timing of the trigger compare register (mtpdntrgcmpx) the trigger compare register (mtpdntrgcmpx) is double-buffered. the timing at which the data written to mtpdntrgcmpx is loaded to the second buffer depends on the setting of mtpdntrgcr. when mtpdntrgcr is set to 1, data written to mtpdntrgcmpx is immediately loaded to the second buffer. table 10-10 trgcmpx buffer update timing according to trigger output mode setting trgxmd mtufx update timing 000:trigger output disabled always updated 001:trigger output on down-count match updated when pwm counter equals mdprd (pwm carrier peak) 010:trigger output on up-count match updated when pwm counter equals 1 (pwm carrier bottom) 011:trigger output on up-/down-count match updated when pwm counter equals 1 or mdprd (pwm carrier peak/bottom) 100:trigger output at pwm carrier peak 101:trigger output at pwm carrier bottom 110:trigger output at pwm carrier peak/bottom 111:trigger output disabled always updated
10 16-bit multi-purpose timers (mpts) tmpm380/m382 tmpm380/m382 - 86 / 87 - ? trigger control register (mtpdntrgcr) 0x4005 0458, 0x4005 04d8 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - read/write r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol trg1be trg1md trg0be trg0md read/write r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 : pmdtrg0 to pmdtrg1 mode setting 000: trigger output disabled 001: trigger output at down-count match 010: trigger output at up-count match 011: trigger output at up-/down-count match 100: trigger output at pwm carrier peak 101: trigger output at pwm carrier bottom 110: trigger output at pwm carrier peak/bottom 111: trigger output disabled this register selects trigger output timing. when the pmd is set to the edge-aligned mode, trigger outputs are made on up-count match or at pwm carrier peak even if down-count matc h or pwm carrier bottom is selected. * when =011, trgcmpx=0x0001 and mdcr=1 (triangular wave), one trigger output is made per period. < trg0be ? trg1be ? trg2be ? trg3be >: pmdtrg0 to pmdtrg1 buffer update timing 0: sync 1: async (the value written to pmdtrgx is immediately reflected.) this bit enables asynchronous updating of the pmdtrg0 to pmdtrg1 buffers. bit[15:7] : write ?00000000?
tmpm380/m382 tmpm380/m382 - 87 / 87 - ? trigger output mode setting register (mtpdntrgmd) 0x4005 045c, 0x4005 04dc 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r 0 r 0 r 0 r 0 r 0 r 0 r 0 r 0 after reset 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 bit symbol - - - - - - - emgtge read/write r 0 r 0 r 0 r 0 r 0 r 0 r/w r/w after reset 0 0 0 0 0 0 0 0 : output enable in emg protection state 0: disable trigger output in the protection state 1: enable trigger output in the protection state this bit enables or disables trigger output in the emg protection state. bit1: write ?0?
tmpm380/m382 tmpm380/m382 - 1 / 39 - 11 12/10-bit analog-to-digital converters the tmpm380 contains a 12/10(selectable)-bit succe ssive-approximation analog-to-digital converter (adc). the adc has 18 analog inputs. functions and features (1) it can select analog input and start ad conversi on when receiving trigger signal from pmd(mpt) or tmrb(interrupt). (2) it can select analog input, in the software tri gger program and the constant trigger program. (3) the adc has twelve register for ad conversion result. (4) the adc generates interrupt signal at the end of the program which was started by pmd(mpt) trigger and tmrb trigger. (5) the adc generates interrupt signal at the end of the program which are the software trigger program and the constant trigger program. (6) the adc has the ad conversion monitoring func tion. when this function is enabled, an interrupt is generated when a conversion result matc hes the specified co mparison value. important tmpm382 (64-pin version) have 10 analog inputs. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 2 / 39 - 11.1 block diagram the following shows a block diagram of the adc. : : : : : : : : : ain0 ? ain1 : : : : : : : : : a in 17 adc cpu pm dtr g0 to 1 avss (vrefl) avdd 5 (vrefh) ph0 (ain0) ph1 (ain1) pj7 (ain17) pm dtr g2 to 3 in tad pd 0 to 1 in tad cp0 to 1 in tad sf t in tad tmr inttm51 fig 11.1 ad converters block diagram note : tmpm382 has 10 analog inputs. the ain0 to ain9 are available. tmpm382 doesn?t have two pmd trigger signal (pmdtrg2,pmdtrg3).
tmpm380/m382 tmpm380/m382 - 3 / 39 - 11.2 list of registers the adcs have the following registers. address register name description 4003_00_00 adclk adc clock setting register 4003_00_04 admod0 adc mode setting register 0 4003_00_08 admod1 adc mode setting register 1 4003_00_0c admod2 adc mode setting register 2 4003_00_10 adcmpcr0 monitoring setting register 0 4003_00_14 adcmpcr1 monitoring setting register 1 4003_00_18 adcmp0 ad conversion result compare register 0 4003_00_1c adcmp1 ad conversion result compare register 1 4003_00_20 adreg0 ad conversion result register 0 4003_00_24 adreg1 ad conversion result register 1 4003_00_28 adreg2 ad conversion result register 2 4003_00_2c adreg3 ad conversion result register 3 4003_00_30 adreg4 ad conversion result register 4 4003_00_34 adreg5 ad conversion result register 5 4003_00_38 adreg6 ad conversion result register 6 4003_00_3c adreg7 ad conversion result register 7 4003_00_40 adreg8 ad conversion result register 8 4003_00_44 adreg9 ad conversion result register 9 4003_00_48 adreg10 ad conversion result register 10 4003_00_4c adreg11 ad conversion result register 11 4003_00_50 adpsel0 pmd trigger program number select register 0 4003_00_54 adpsel1 pmd trigger program number select register 1 4003_00_58 adpsel2 pmd trigger program number select register 2 4003_00_5c adpsel3 pmd trigger program number select register 3 4003_00_80 adpints0 pmd trigger interrupt select register 0 4003_00_84 adpints1 pmd trigger interrupt select register 1 4003_00_88 adpints2 pmd trigger interrupt select register 2 4003_00_8c adpints3 pmd trigger interrupt select register 3 4003_00_90 adpints4 pmd trigger interrupt select register 4 4003_00_94 adpints5 pmd trigger interrupt select register 5 4003_00_98 adpset0 pmd trigger program register 0 4003_00_9c adpset1 pmd trigger program register 1 4003_00_a0 adpset2 pmd trigger program register 2 4003_00_a4 adpset3 pmd trigger program register 3 4003_00_a8 adpset4 pmd trigger program register 4 4003_00_ac adpset5 pmd trigger program register 5 4003_00_b0 adtset03 timer trigger program registers 0 to 3 4003_00_b4 adtset47 timer trigger program registers 4 to 7 4003_00_b8 adtset811 timer trigger program registers 8 to 11 4003_00_bc adsset03 software program registers 0 to 3 4003_00_c0 adsset47 software program registers 4 to 7 4003_00_c4 adsset811 software program registers 8 to 11 4003_00_c8 adaset03 constant conversion program registers 0 to 3 4003_00_cc adaset47 constant conversion program registers 4 to 7 4003_00_d0 adaset811 constant conversion program registers 8 to 11 4003_00_d4 admod3 adc mode setting register 3 table 11.1 ad conversion registers
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 4 / 39 - 11.3 register descriptions ad conversion is performed at the clock frequency selected in the adc clock setting register. 11.3.1 adc clock setting register (adclk) 7 6 5 4 3 2 1 0 bit symbol - tsh3 tsh2 tsh1 tsh0 adclk2 adclk1 adclk0 read/write r r/w r/w after reset 0 1011 000 adclk 0x4003_0000 function always read as 0. write ?1001? ad prescaler output (sclk) select 000: fc 001: reserved 010: reserved 011: reserved 1xx: reserved note1: ad conversion time(t) is as follow; 12-bit mode : t=74*(1/sclk), 10-bit mode : t=68*(1/sclk)
tmpm380/m382 tmpm380/m382 - 5 / 39 - 11.3.2 mode setting registers the adc mode setting registers (admod0, admod1, admod2 and admod3) are used to select how ad conversion is started. 11.3.2.1 admod0 7 6 5 4 3 2 1 0 bit symbol - dacon adss read/write r r/w w after reset 0 0 0 admod0 0x4003_0004 function always read as 0. dac control 0: off 1: on software triggered conversion 0 don't care 1: start setting to ?1?, when using the adc. setting to ? 1 ? starts ad conversion (software triggered c onversion). receiving trigger signal from pmd(mpt) or tmrb(interrupt) starts ad conversion also. for detail setting, please read the chapter about pmd(mpt) and tmrb. 11.3.2.2 admod1 7 6 5 4 3 2 1 0 bit symbol aden - adas read/write r/w r r/w after reset 0 0 0 admod1 0x4003_0008 function ad conversion control 0: disable 1: enable always read as 0. constant ad conversion control 0: disable 1: enable setting to ?1?, when using the adc. after setti ng to ?1?, setting to ?1? starts ad conversion and repeat conversion. 11.3.2.3 admod2 7 6 5 4 3 2 1 0 bit symbol - adsfn adbfn read/write r r r after reset 0 0 0 admod2 0x4003_000c function always read as 0. software conversion busy flag 0: conversion completed 1: conversion in progress ad conversion busy flag 0: conversion not in progress 1: conversion in progress the is an ad conversion busy flag. when ad conversion is started regardless of conversion factor (pmd, timer, software, constant), is set to ?1?. when finished ad conversion, is cleared to ?0?. the is a software ad conversion busy flag. af ter was set to ?1?, when ad conversion is actually started, is set to ?1?. when fini shed ad conversion, is cleared to ?0?.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 6 / 39 - 11.3.2.4 admod3 admod3 ? 7 6 5 4 3 2 1 0 bitsymbol - - pmode2 pmode1 pmode0 - - read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 1 0 1 1 0 0 0 ? ? admod3 0x4003_00d4 ? ? ? ? ? ? function write same value as initial value. write ?100? write same value as initial value. ? 15 14 13 12 11 10 9 8 bitsymbol - - - - bits1 bits0 rcut read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 1 0 1 ? ? ? ? ? ? ? function write same value as initial value. bit resolution selector 00:10bit 01:12bit 10:reserved 11:reserved ? write ?0? ? low power mode select ? ? 0:normal 1:low power ? note : must be set to ?100?. and do not change other bits in admod3 register. the adc can select the resolution of 10bits or 12bits. setting the / on admod3 register. the adc can decrease the current consumption when stopping. setti ng the to ?1? enables the admod3 register.
tmpm380/m382 tmpm380/m382 - 7 / 39 - 11.3.3 monitoring setting registers the adcs have the ad conversion result monitoring function. 11.3.3.1 adcmpcr0,adcmpcr1 the adcmpcr0 an d adcmpcr1 registers are used to enable or disable comparison between an ad c onversion result and the specified comparison value, to select the register to be compared with an ad conversion result and to set how many times comp arison should be performed to determine the result. after fixing the conversion result, the inte rrupt signal(intadcp0,intadcp1) is generated. adcmpcr0 7 6 5 4 3 2 1 0 bit symbol cmp0en - - adbig0 regs03 regs02 regs01 regs00 read/write r/w r r r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adcmpcr0 0x0043_0010 function monitoring function 0: disable 1: enable always read as 0. always read as 0. comparison condition 0: larger than or equal to compare register 1: smaller than or equal to compare register ad conversion result register to be compared 0000: adreg0 0100: adreg4 1000: adreg8 0001: adreg1 0101: adreg5 1001: adreg9 0010: adreg2 0110: adreg6 1010: adreg10 0011: adreg3 0111: adreg7 1011: adreg11 15 14 13 12 11 10 9 8 bit symbol - - - - cmpcnt03 cmpcnt02 cmpcnt01 cmpcnt00 read/write r r r r r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function always read as 0. always read as 0. always read as 0. always read as 0. comparison count for determining the result 0000: after every comparison 0001: after two comparisons ???? ???? 1111: after 16 comparisons adcmpcr1 7 6 5 4 3 2 1 0 bit symbol cmp1en - - adbig1 regs13 regs12 regs11 regs10 read/write r/w r r r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adcmpcr1 0x4003_0014 function monitoring function 0: disable 1: enable always read as 0. always read as 0. comparison condition 0: larger than or equal to compare register 1: smaller than or equal to compare register ad conversion result register to be compared 0000: adreg0 0100: adreg4 1000: adreg8 0001: adreg1 0101: adreg5 1001: adreg9 0010: adreg2 0110: adreg6 1010: adreg10 0011: adreg3 0111: adreg7 1011: adreg11 15 14 13 12 11 10 9 8 bit symbol - - - - cmpcnt13 cmpcnt12 cmpcnt11 cmpcnt10 read/write r r r r r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function always read as 0. always read as 0. always read as 0. always read as 0. comparison count for determining the result 0000: after every comparison 0001: after two comparisons ???? ???? 1111: after 16 comparisons
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 8 / 39 - 11.3.3.2 conversion result compare register the adcmp0 and adcmp1 registers specify the value to be compared with an ad conversion result. the upper 12 bits (bits 4 to 15) are used. adcmp0 7 6 5 4 3 2 1 0 bit symbol ad0cmp03 ad0cmp 02 ad0cmp01 ad0cmp00 - - - - read/write r/w r/w r/w r/w r r r r after reset 0 0 0 0 0 0 0 0 adcmp0 0x4003_0018 function bits 0 to 3 of the value to be compared with an ad conversion result always read as 0. 15 14 13 12 11 10 9 8 bit symbol ad0cmp11 ad0c mp10 ad0cmp09 ad0cmp08 ad0cmp 07 ad0cmp06 ad0cmp05 ad0cmp04 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of the value to be compared with an ad conversion result adcmp1 7 6 5 4 3 2 1 0 bit symbol ad1cmp03 ad1cmp 02 ad1cmp01 ad1cmp00 - - - - read/write r/w r/w r/w r/w r r r r after reset 0 0 0 0 0 0 0 0 adcmp1 0x4003_001c function bits 0 to 3 of the value to be compared with an ad conversion result always read as 0. 15 14 13 12 11 10 9 8 bit symbol ad1cmp11 ad1c mp10 ad1cmp09 ad1cmp08 ad1cmp 07 ad1cmp06 ad1cmp05 ad1cmp04 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of the value to be compared with an ad conversion result
tmpm380/m382 tmpm380/m382 - 9 / 39 - 11.3.4 ad conversion result registers 11.3.4.1 adreg0 to adreg11 the adregn (n = 0 to 11) register is used to store the result of an ad conversion. bit 0 (adrnrf) is a flag that is set when an ad conversion result is st ored in the adregn register and is cleared when the low-order byte of adregn is read. bit 1 (ovrn) is an overrun flag. this flag is set when a new ad conversion result is stored befor e the low-order byte of adregn is read and is cleared when the low-order byte of adregn is read. there are twelve adregn registers, which are all functionally equivalent. adreg0 7 6 5 4 3 2 1 0 bit symbol adr003 adr002 adr001 adr000 - - ovr0 adr0rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg0 0x4003_0020 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr011 adr010 adr009 adr008 adr007 adr006 adr005 adr004 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg1 7 6 5 4 3 2 1 0 bit symbol adr103 adr102 adr101 adr100 - - ovr0 adr1rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg1 0x4003_0024 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr111 adr110 adr109 adr108 adr107 adr106 adr105 adr104 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 10 / 39 - adreg2 7 6 5 4 3 2 1 0 bit symbol adr203 adr202 adr201 adr200 - - ovr0 adr2rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg2 0x4003_0028 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr211 adr210 adr209 adr208 adr207 adr206 adr205 adr204 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg3 7 6 5 4 3 2 1 0 bit symbol adr303 adr302 adr301 adr300 - - ovr0 adr3rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg3 0x4003_002c function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr311 adr310 adr309 adr308 adr307 adr306 adr305 adr304 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg4 7 6 5 4 3 2 1 0 bit symbol adr403 adr402 adr401 adr400 - - ovr0 adr4rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg4 0x4003_0030 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr411 adr410 adr409 adr408 adr407 adr406 adr405 adr404 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result
tmpm380/m382 tmpm380/m382 - 11 / 39 - adreg5 7 6 5 4 3 2 1 0 bit symbol adr503 adr502 adr501 adr500 - - ovr0 adr5rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg5 0x4003_0034 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr511 adr510 adr509 adr508 adr507 adr506 adr505 adr504 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg6 7 6 5 4 3 2 1 0 bit symbol adr603 adr602 adr601 adr600 - - ovr0 adr6rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg6 0x4003_0038 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr611 adr610 adr609 adr608 adr607 adr606 adr605 adr604 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg7 7 6 5 4 3 2 1 0 bit symbol adr703 adr702 adr701 adr700 - - ovr0 adr7rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg7 0x4003_003c function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr711 adr710 adr709 adr708 adr707 adr706 adr705 adr704 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 12 / 39 - adreg8 7 6 5 4 3 2 1 0 bit symbol adr803 adr802 adr801 adr800 - - ovr0 adr8rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg6 0x4003_0040 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr811 adr810 adr809 adr808 adr807 adr806 adr805 adr804 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg9 7 6 5 4 3 2 1 0 bit symbol adr903 adr902 adr901 adr900 - - ovr0 adr9rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg9 0x4003_0044 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr911 adr910 adr909 adr908 adr907 adr906 adr905 adr904 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result adreg10 7 6 5 4 3 2 1 0 bit symbol adr1003 adr1002 adr 1001 adr1000 - - ovr0 adr10rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg10 0x4003_0048 function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr1011 adr1010 adr1009 adr1008 adr1007 adr1006 adr1005 adr1004 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result
tmpm380/m382 tmpm380/m382 - 13 / 39 - adreg1 1 7 6 5 4 3 2 1 0 bit symbol adr1103 adr1102 adr1101 adr1100 - - ovr0 adr11rf read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 adreg11 0x4003_004c function bits 0 to 3 of an ad conversion result always read as 0. always read as 0. overrun flag 0: no overrun occurred 1: overrun occurred ad conversion result store flag 0: no result stored 1: result stored 15 14 13 12 11 10 9 8 bit symbol adr1111 adr1110 adr1 109 adr1108 adr1107 adr1106 adr1105 adr1104 read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function bits 4 to 11 of an ad conversion result
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 14 / 39 - 11.3.5 pmd trigger program registers ad conversion can be started by a tri gger from the pmd (mpt: pmd mode). the pmd trigger program registers are used to spec ify the program to be st arted by each of four triggers generated by the pmd, to select the inte rrupt to be generated upon completion of the program and to select the ain input to be used. the pmd trigger program registers include three types of registers: pmd trigger program number select register (adpselp), pmd trigger interrupt select register (adpintsn) and pmd trigger program setting register (adpsetnm). (p=0 to 3, n=0 to 5, m=0 to 3) ???? pmd trigger program registers program 1 program 0 program 3 program 2 program 5 program 4 a dpints1 a dpst10 a dpst11 a dpst12 a dpst13 a dpints0 a dpst00 a dpst01 a dpst02 a dpst03 a dpints3 a dpst30 a dpst31 a dpst32 a dpst33 a dpints2 a dpst20 a dpst21 a dpst22 a dpst23 a dpints5 a dpst50 a dpst51 a dpst52 a dpst53 a dpints4 a dpst40 a dpst41 a dpst42 a dpst43 a dpsel0 a dpsel1 a dpsel2 a dpsel3 pmd trigger program number select registers pmd trigger interrupt setting registers conversion result register 0 conversion result register 1 conversion result register 2 conversion result register 3 pmd trigger program setting registers 0-5 the pmd trigger program number select register (adpseln) specifies th e program to be started by each of four ad conversion start signals corre sponding to four triggers generated by the pmd. programs 0 to 5 are available. the pmd trigger interrupt select register (a dpintn) selects the interrupt to be generated upon completion of each program, and enables or disables the interrupt. the pmd trigger program setting register (adpsetn m) specifies the setti ngs for each of programs 0 to 5. each pmd trigger program register is compri sed of four registers for specifying the ain input to be converted. the conversion re sults corresponding to the adpsetn0 to adpsetn3 registers are stored in the conversion result registers 0 to 3 (adreg0 to adreg3).
tmpm380/m382 tmpm380/m382 - 15 / 39 - 11.3.5.1 pmd trigger program number select registers the pmd trigger program number select r egisters (adpsel0 to adpsel03) select the program to be started (from among programs 0 to 5) by each of trigger inputs pmd0 to pmd3. pmd trigger program number select register 0 (adpsel0) 7 6 5 4 3 2 1 0 bit symbol pens0 - - - - pmds02 pmds01 pmds00 read/write r/w r r r r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adpsel0 0x4003_0050 function pmd trigger program select register 0 enable 0: disable 1: enable always read as 0. always read as 0. always read as 0. always read as 0. program number select 000: program 0 100: program 4 001: program 1 101: program 5 010 program 2 110,111: reserved 011: program 3 pmd trigger program number select register 1 (adpsel1) 7 6 5 4 3 2 1 0 bit symbol pens1 - - - - pmds12 pmds11 pmds10 read/write r/w r r r r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adpsel1 0x4003_0054 function pmd trigger program select register 1 enable 0: disable 1: enable always read as 0. always read as 0. always read as 0. always read as 0. program number select 000: program 0 100: program 4 001: program 1 101: program 5 010 program 2 110,111: reserved 011: program 3 pmd trigger program number select register 2 (adpsel2) 7 6 5 4 3 2 1 0 bit symbol pens2 - - - - pmds22 pmds21 pmds20 read/write r/w r r r r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adpsel2 0x4003_0058 function pmd trigger program select register 2 enable 0: disable 1: enable always read as 0. always read as 0. always read as 0. always read as 0. program number select 000: program 0 100: program 4 001: program 1 101: program 5 010 program 2 110,111: reserved 011: program 3 pmd trigger program number select register 3 (adpsel3) 7 6 5 4 3 2 1 0 bit symbol pens3 - - - - pmds32 pmds31 pmds30 read/write r/w r r r r r/w r/w r/w after reset 0 0 0 0 0 0 0 0 adpsel3 0x4003_005c function pmd trigger program select register 3 enable 0: disable 1: enable always read as 0. always read as 0. always read as 0. always read as 0. program number select 000: program 0 100: program 4 001: program 1 101: program 5 010: program 2 110, 111: reserved 011: program 3
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 16 / 39 - 11.3.5.2 pmd trigger interrupt select registers the pmd trigger interrupt select registers (adpin ts0 to adpints5) select the interrupt to be generated for each of programs 0 to 5. adpints0 (for program 0) 7 6 5 4 3 2 1 0 bit symbol - in tsel01 intsel00 read/write r r/w after reset 0 adpints0 0x4003_0080 function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output adpints1 (for program 1) 7 6 5 4 3 2 1 0 bit symbol - in tsel11 intsel10 read/write r r/w after reset 0 adpints1 0x4003_0084 function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output adpints2 (for program 2) 7 6 5 4 3 2 1 0 bit symbol - in tsel21 intsel20 read/write r r/w after reset 0 adpints2 0x4003_0088 function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output adpints3 (for program 3) 7 6 5 4 3 2 1 0 bit symbol - in tsel31 intsel30 read/write r r/w after reset 0 adpints3 0x4003_008c function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output
tmpm380/m382 tmpm380/m382 - 17 / 39 - adpints4 (for program 4) 7 6 5 4 3 2 1 0 bit symbol - in tsel41 intsel40 read/write r r/w after reset 0 adpints4 0x4003_0090 function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output adints5 (for program 5) 7 6 5 4 3 2 1 0 bit symbol - in tsel51 intsel50 read/write r r/w after reset 0 adpins5 0x4003_0094 function always read as 0. interrupt select 00: no interrupt output 01: intadpd0 10: intadpd1 11: no interrupt output
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 18 / 39 - 11.3.5.3 pmd trigger program setting registers 0 to 5 each of the pmd trigger program registers (adp set0 to 5) are comprised of four registers. these four registers are used to select the ad conversion input pin (ain0 to ain17). the numbers of these registers corres pond to those of the conver sion result registers. setting the to 1 enables the adpsetnm register. the bits are used to select the ain pin to be used. the numbers of the pmd trigger program setting registers correspond to those of the conversion result registers. (n= 0 to 5 , m= 0 to 3) pmd trigger program register 0 (adpset0) 7 6 5 4 3 2 1 0 bit symbol ensp00 - - ainsp004 ai nsp003 ainsp002 ainsp001 ainsp000 read/write r/w r/w r/w after reset 0 0 0 adpset0 0x4003_0098 function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp01 - - ainsp014 ai nsp013 ainsp012 ainsp011 ainsp010 read/write r/w r/w r/w after reset 0 0 0 function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp02 - - ainsp024 ai nsp023 ainsp022 ainsp021 ainsp020 read/write r/w r/w r/w after reset 0 0 0 function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp03 - - ainsp034 ai nsp033 ainsp032 ainsp031 ainsp030 read/write r/w r/w r/w after reset 0 0 0 function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 19 / 39 - pmd trigger program register 1 (adpset1) 7 6 5 4 3 2 1 0 bit symbol ensp10 - - ainsp104 ai nsp103 ainsp102 ainsp101 ainsp100 read/write r/w r/w r/w after reset 0 0 0 adpset1 0x4003_009c function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp11 - - ainsp114 ai nsp113 ainsp112 ainsp111 ainsp110 read/write r/w r/w r/w after reset 0 0 0 adpset11 0x4003_009d function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp12 - - ainsp124 ai nsp123 ainsp122 ainsp121 ainsp120 read/write r/w r/w r/w after reset 0 0 0 adpset12 0x4003_009e function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp13 - - ainsp134 ai nsp133 ainsp132 ainsp131 ainsp130 read/write r/w r/w r/w after reset 0 0 adpset13 0x4003_009f function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 20 / 39 - pmd trigger program register 2(adpset2) 7 6 5 4 3 2 1 0 bit symbol ensp20 - - ainsp204 ai nsp203 ainsp202 ainsp201 ainsp200 read/write r/w r/w r/w after reset 0 0 0 adpset2 0x4003_00a0 function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp21 - - ainsp214 ai nsp213 ainsp212 ainsp211 ainsp210 read/write r/w r/w r/w after reset 0 0 0 adpset21 0x4003_00a1 function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp22 - - ainsp224 ai nsp223 ainsp222 ainsp221 ainsp220 read/write r/w r/w r/w after reset 0 0 0 adpset22 0x4003_00a2 function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp23 - - ainsp234 ai nsp233 ainsp232 ainsp231 ainsp230 read/write r/w r/w r/w after reset 0 0 adpset23 0x4003_00a3 function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (0 1111 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 21 / 39 - pmd trigger program register 3(adpset3) 7 6 5 4 3 2 1 0 bit symbol ensp30 - - ainsp304 ai nsp303 ainsp302 ainsp301 ainsp300 read/write r/w r/w r/w after reset 0 0 0 adpset3 0x4003_00a4 function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp31 - - ainsp314 ai nsp313 ainsp312 ainsp311 ainsp310 read/write r/w r/w r/w after reset 0 0 adpset31 0x4003_00a5 function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp32 - - ainsp324 ai nsp323 ainsp322 ainsp321 ainsp320 read/write r/w r/w r/w after reset 0 0 adpset32 0x4003_00a6 function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp33 - - ainsp334 ai nsp333 ainsp332 ainsp331 ainsp330 read/write r/w r/w r/w after reset 0 0 adpset33 0x4003_00a7 function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 22 / 39 - pmd trigger program register 4(adpset4) 7 6 5 4 3 2 1 0 b t symbol ensp40 - - ainsp404 ai nsp403 ainsp402 ainsp401 ainsp400 read/write r/w r/w r/w after reset 0 0 0 adpset4 0x4003_00a8 function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp41 - - ainsp414 ai nsp413 ainsp412 ainsp411 ainsp410 read/write r/w r/w r/w after reset 0 0 0 adpset41 0x4003_00a9 function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp42 - - ainsp424 ai nsp423 ainsp422 ainsp421 ainsp420 read/write r/w r/w r/w after reset 0 0 0 adpset42 0x4003_00aa function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp43 - - ainsp434 ai nsp433 ainsp432 ainsp431 ainsp430 read/write r/w r/w r/w after reset 0 0 0 adpset43 0x4003_00ab function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 23 / 39 - pmd trigger program register 5(adpset5) 7 6 5 4 3 2 1 0 bit symbol ensp50 - - ainsp504 ai nsp503 ainsp502 ainsp501 ainsp500 read/write r/w r/w r/w after reset 0 0 adpset5 0x4003_00ac function reg0 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensp51 - - ainsp514 ai nsp513 ainsp512 ainsp511 ainsp510 read/write r/w r/w r/w after reset 0 0 adpset51 0x4003_00ad function reg1 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensp52 - - ainsp524 ai nsp523 ainsp522 ainsp521 ainsp520 read/write r/w r/w r/w after reset 0 0 adpset52 0x4003_00ae function reg2 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensp53 - - ainsp534 ai nsp533 ainsp532 ainsp531 ainsp530 read/write r/w r/w r/w after reset 0 0 adpset53 0x4003_00af function reg3 enable 0: disable 1: enable reserved ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 24 / 39 - 11.3.6 timer trigger program registers ad conversion can be started by trigger from time r5(tmrb5). there are twelve 8-bit registers for programming timer triggers. setting the to ?1? enables the adtsetm register. the are used to select the ain pin to be used. the numbers of the timer trigger program registers correspond to those of the ad conversion result registers. when finished this ad conversion, interrupt:intadtmr is generated. (m= 0 to 11, n= 0 to 4) timer trigger program register 03 (adtset03) 7 6 5 4 3 2 1 0 bit symbol enst0 - - ainst04 ai nst03 ainst02 ainst01 ainst00 read/write r/w r r r/w after reset 0 0 0 0 adtset03 0x4003_00b0 function reg0 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enst1 - - ainst14 ai nst13 ainst12 ainst11 ainst10 read/write r/w r r r/w after reset 0 0 0 0 adtset1 0x4003_00b1 function reg1 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enst2 - - ainst24 ai nst23 ainst22 ainst21 ainst20 read/write r/w r r r/w after reset 0 0 0 0 adtset2 0x4003_00b2 function reg2 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enst3 - - ainst34 ai nst33 ainst32 ainst31 ainst30 read/write r/w r r r/w after reset 0 0 0 0 adtset3 0x4003_00b3 function reg3 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 25 / 39 - timer trigger program register 47 (adtset47) 7 6 5 4 3 2 1 0 bit symbol enst4 - - ainst44 ai nst43 ainst42 ainst41 ainst40 read/write r/w r r r/w after reset 0 0 0 0 adtset47 0x4003_00b4 function reg4 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enst5 - - ainst54 ai nst53 ainst52 ainst51 ainst50 read/write r/w r r r/w after reset 0 0 0 0 function reg5 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enst6 - - ainst64 ai nst63 ainst62 ainst61 ainst60 read/write r/w r r r/w after reset 0 0 0 0 function reg6 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enst7 - - ainst74 ai nst73 ainst72 ainst71 ainst70 read/write r/w r r r/w after reset 0 0 0 0 function reg7 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 26 / 39 - timer trigger program register 811 (adtset811) 7 6 5 4 3 2 1 0 bit symbol enst8 - - ainst84 ai nst83 ainst82 ainst81 ainst80 read/write r/w r r r/w after reset 0 0 0 0 adtset811 0x4003_00b8 function reg8 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enst9 - - ainst94 ai nst93 ainst92 ainst91 ainst90 read/write r/w r r r/w after reset 0 0 0 0 function reg9 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enst10 - - ainst104 ai nst103 ainst102 ainst101 ainst100 read/write r/w r r r/w after reset 0 0 0 0 function reg10 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enst11 - - ainst114 ai nst113 ainst112 ai nst111 ainst110 read/write r/w r r r/w after reset 0 0 0 0 function reg11 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 27 / 39 - 11.3.7 software trigger program registers ad conversion can be started by software. there are twelve 8-bit registers for programming software triggers. setting the to ?1? enables the adssetn register. the are used to select the ain pin to be used. the numbers of the software trigger program registers correspond to those of t he conversion result registers. when finished this ad conversion, interrupt:intadsft is generated. (n= 0 to 11, m= 0 to 4) software trigger program register 03 (adsset03) 7 6 5 4 3 2 1 0 bit symbol enss0 - - ainss04 ai nss03 ainss02 ainss01 ainss00 read/write r/w r r r/w after reset 0 0 0 adsset03 0x4003_00bc function reg0 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enss1 - - ainss14 ai nss13 ainss12 ainss11 ainss10 read/write r/w r r r/w after reset 0 0 0 adsset1 0x4003_00bd function reg1 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enss2 - - ainss24 ai nss23 ainss22 ainss21 ainss20 read/write r/w r r r/w after reset 0 0 0 adsset2 0x4003_00be function reg2 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enss3 - - ainss34 ai nss33 ainss32 ainss31 ainss30 read/write r/w r r r/w after reset 0 0 0 adsset3 0x4003_00bf function reg3 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 28 / 39 - software trigger program register 47 (adsset47) 7 6 5 4 3 2 1 0 bit symbol enss4 - - ainss44 ai nss43 ainss42 ainss41 ainss40 read/write r/w r r r/w after reset 0 0 0 adsset47 0x4003_00c0 function reg4 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enss5 - - ainss54 ai nss53 ainss52 ainss51 ainss50 read/write r/w r r r/w after reset 0 0 0 function reg5 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enss6 - - ainss64 ai nss63 ainss62 ainss61 ainss60 read/write r/w r r r/w after reset 0 0 0 function reg6 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enss7 - - ainss74 ai nss73 ainss72 ainss71 ainss70 read/write r/w r r r/w after reset 0 0 0 function reg7 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 29 / 39 - software trigger program register 811 (adsset811) 7 6 5 4 3 2 1 0 bit symbol enss8 - - ainss84 ai nss83 ainss82 ainss81 ainss80 read/write r/w r r r/w after reset 0 0 0 adsset811 0x4003_00c4 function reg8 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol enss9 - - ainss94 ai nss93 ainss92 ainss91 ainss90 read/write r/w r r r/w after reset 0 0 0 function reg9 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol enss10 - - ainss104 ai nss103 ainss102 ainss101 ainss100 read/write r/w r r r/w after reset 0 0 0 function reg10 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol enss11 - - ainss114 ai nss113 ainss112 ainss111 ainss110 read/write r/w r r r/w after reset 0 0 0 function reg11 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 30 / 39 - 11.3.8 constant conversion program registers the adc allow conversion triggers to be constantly enabled. there are twelve 8-bit registers for programming constant triggers. setting the to ?1? enables the adasetm register. the are used to select the ain pin to be used. the numbers of the constant trigger program registers correspond to those of the conversion result registers. (m= 0 to 11, n= 0 to 4) constant conversion program register 03 (adaset03) 7 6 5 4 3 2 1 0 bit symbol ensa0 - - ainsa04 ai nsa03 ainsa02 ainsa01 ainsa00 read/write r/w r r r/w after reset 0 0 0 0 adaset03 0x4003_00c8 function reg0 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensa1 - - ainsa14 ai nsa13 ainsa12 ainsa11 ainsa10 read/write r/w r r r/w after reset 0 0 0 0 function reg1 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensa2 - - ainsa24 ai nsa23 ainsa22 ainsa21 ainsa20 read/write r/w r r r/w after reset 0 0 0 0 function reg2 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensa3 - - ainsa34 ai nsa33 ainsa32 ainsa31 ainsa30 read/write r/w r r r/w after reset 0 0 0 0 function reg3 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 31 / 39 - constant conversion program register 47 (adaset47) 7 6 5 4 3 2 1 0 bit symbol ensa4 - - ainsa44 ai nsa43 ainsa42 ainsa41 ainsa40 read/write r/w r r r/w after reset 0 0 0 0 adaset47 0x4003_00cc function reg4 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensa5 - - ainsa54 ai nsa53 ainsa52 ainsa51 ainsa50 read/write r/w r r r/w after reset 0 0 0 0 function reg5 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensa6 - - ainsa64 ai nsa63 ainsa62 ainsa61 ainsa60 read/write r/w r r r/w after reset 0 0 0 0 function reg6 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensa7 - - ainsa74 ai nsa73 ainsa72 ainsa71 ainsa70 read/write r/w r r r/w after reset 0 0 0 0 function reg7enabl e 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 32 / 39 - constant conversion program register 811 (adaset811) 7 6 5 4 3 2 1 0 bit symbol ensa8 - - ainsa84 ai nsa83 ainsa82 ainsa81 ainsa80 read/write r/w r r r/w after reset 0 0 0 0 adaset811 0x4003_00d0 function reg8 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 15 14 13 12 11 10 9 8 bit symbol ensa9 - - ainsa94 ai nsa93 ainsa92 ainsa91 ainsa90 read/write r/w r r r/w after reset 0 0 0 0 function reg9 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 23 22 21 20 19 18 17 16 bit symbol ensa10 - - ainsa104 ai nsa103 ainsa102 ainsa101 ainsa100 read/write r/w r r r/w after reset 0 0 0 0 function reg10 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) 31 30 29 28 27 26 25 24 bit symbol ensa11 - - ainsa114 ai nsa113 ainsa112 ainsa111 ainsa110 read/write r/w r r r/w after reset 0 0 0 0 function reg11 enable 0: disable 1: enable always read as 0. always read as 0. ain select 00000: ain0 00001: ain1 : 10001: ain17 (10010 to 11111: reserved) note : tmpm382fw/m382fs have 10 analog inpu ts. the ain0 to ain9 are available.
tmpm380/m382 tmpm380/m382 - 33 / 39 - 11.4 operation descriptions 11.4.1 analog reference voltages for the high-level and low-level analog refe rence voltages, the avdd5 and avss pins are used in adc. there are no registers for controlling current between avdd5 and avss. inputs to these pins are fixed. the adc can decrease the curr ent consumption w hen stopping. setting the to ?1? enables the admod3 register. note : analog input pins also use input/output ports(port h/ i/ j), it is recommended for the purpose of maintaining the accuracy of ad conversion result that do not execute input/output instructions during ad conversi on. additionally, do not input widely varying signals into the ports adjacent to analog input pins. 11.4.2 starting ad conversion ad conversion is started by software or one of the following three trigger signals. ?? pmd trigger (see ? 11.3.5 pmd trigger program registers?) ?? ti mer trigger (tmrb5) (see ?1 1.3.6 timer trigger program registers?) ?? soft ware trigger (see ? 1 1.3.7 software trigger program registers? these start triggers are given priorities as shown below. pmd trigger 0 > y y y >pmd trigger 3 > timer trigger > software trigger > constant trigger if the pmd trigger occurs while an ad conversion is in progress, the pmd trigger is handled stop the ongoing program and start ad conversion correspond to pmd trigger number. if a higher-priority trigger occurs while an ad conver sion is in progress, the higher-priority trigger is handled after the ongoing program is completed. it has some delay from generation of trigger to start of ad conversion. the delay depends on the trigger. the following timing chart and table show the delay. 1st conversion 2nd conversion result of 1st conversion result of 2nd conversion trigger busy flag adbfn ad conversion result register0 (adxreg0) delay time from trigger ad conversion time delay time to the next conversion ad conversion result register1 (adxreg1) ad conversion time fig 11.2 figure timing chart of a/d conversion
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 34 / 39 - table 11.2 table a/d conversion time (sclk=40mhz) ???????? ???????????[ s] fsys=40mhz trigger min max pmd 0.225 0.3 tmrb 0.225 0.5 delay time from trigger (note 1) software, constant 0.25 0.525 ad conversion time 1.85 pmd 0.175 0.225 delay time to the next conversion (note 2) tmrb, software, constant 0.175 0.425 ?? note 1: delay time from trigger to start of ad conversion. ?? note 2: delay time to the 2nd or after conversion in plural conversions with one trigger. 11.4.3 ad conversion monitoring function the adc has the ad conversion monitoring function. when this function is enabled, an interrupt is generated when a conversion result matc hes the specified comparison value. to enable the monitoring function set adcm pcr0 or adcmpcr1 to ?1 ? . in the monitoring function if the val ue of ad conversion result register to which the monitoring function is assigned corresponds to the comparison conditi on specified by adcmcr the interrupt (intadcpa for adcmpcr0, intadcpb for adcmpcr1 ) is generated. the comparison is executed at the timing of storing the conversion result into the register. note 1: the ad conversion result store flag (adr xrf) is not cleared by the comparison function. ?? note 2: the comparison function differs from reading the conversion result by so ftware. therefore, if the next conversion is completed without reading the previous result, the overr un flag (ovrs) is set.
tmpm380/m382 tmpm380/m382 - 35 / 39 - 11.5 timing chart of ad conversion the following shows a timing chart of software trigger conversion, constant conversion and acceptance of trigger. 11.5.1 software trigger conversion in the software trigger conversion, the interrupt is generated after completion of conversion programmed by adsset03, adsset47 and adsset811. if the admod1 is cleared to ?0? during ad conversion, the ongoing c onversion stops without storing to the result register. fig 11.3 software trigger ad conversion fig 11.4 writing ?0? to aden during the software trigger ad conversion
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 36 / 39 - 11.5.2 constant conversion in the constant conversion, if the next conversion completes without reading the previous result from the conversion result register, the overrun flag is set to ?1?. in this case, the previous conversion result in the conversion result register is overwritten by the next result. th e overrun flag is cleared by the conversion result. fig 11.5 constant conversion
tmpm380/m382 tmpm380/m382 - 37 / 39 - 11.5.3 ad conversion by trigger if the pmd trigger is occurred during the software trigger conversion, the ongoing conversion stops immediately. if the timer trigger is occurred during the software trigger conversion, the ongoing conversion stops after the completion of ongoing conversion. after the completion of conversion by trigger, the software trigger conversion starts fr om the beginning programmed by adsset03, adsset47 and adsset811. fig 11.6 ad conversion by pmd trigger fig 11.7 ad conversion by timer trigger (1)
11 12/10-bit analog-to-digital converters tmpm380/m382 tmpm380/m382 - 38 / 39 - fig 11.8 ad conversion by timer trigger (2)
tmpm380/m382 tmpm380/m382 - 39 / 39 - cautions the result value of ad conversion may vary depend ing on the fluctuation of the supply voltage, or may be affected by noise. when using analog input pins and ports alternately, do not read and write ports during conversion because the conversion accuracy may be reduced. also the conversion accuracy may be reduced if the output ports current fl uctuate during ad conversion. please take counteractive measur es with the program such as averaging the ad conversion results.
tmpm380/m382 tmpm380/m382 - 1 / 23 - 12 encoder input circuit (enc) the tmpm380 has a two-channel incremental enco der interface (enc0/1), which can determine the direction and the absolute position of a motor, base d on input signals from an incremental encoder. the discussions in this chapter apply to enc0. for enc1, the names of registers, interrupt signals and pins in the following text should be replaced as appropriate, as shown in table 12-1 to table 12-3 . t able 12 -1 li st of the enc registers enc0 enc1 register register symbol address register symbol address encoder input control register en0tncr 0x4001_0400 en1tncr 0x4001_0500 encoder counter reload register en0reload 0x4001_0404 en1reload 0x4001_0504 encoder compare register en0int 0x4001_0408 en1int 0x4001_0508 encoder counter en0cnt 0x4001_040c en1cnt 0x4001_050c table 12-2 interrupt sources interrupt source enc0 enc1 enc interrupt intenc0 intenc1 table 12-3 pin names pin enc0 enc1 channel a input pin pd0/enca0 pf2/enca1 channel b input pin pd1/encb0 pf3/encb1 channel z input pin pd2/encz0 pf4/encz1 important tmpm382 (64-pin version) does not implement enc0 and enc1. please do not use these functions.
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 2 / 23 - 12.1 outline the enc can be configured to operate in one of f our different modes: encoder mode, two sensor modes (event count mode, timer count mode) and ti mer mode. and it also has some functions as below. z supports incremental encoders and hall sensor ic s. (signals of hall sensor ic can be input directly) z 24-bit general-purpose timer mode z multiply-by-4 (multiply-by-6) logic z direction discriminator z 24-bit counter z comparator enable/disable z interrupt request output z digital noise filters for input signals fig 12-1 enc block diagram enca0 encb0 encz0 input selector noise filter interrupt request control interrupt request intenc0 decoder noise filter noise filter counter
tmpm380/m382 tmpm380/m382 - 3 / 23 - 12.1.1 encoder mode in encoder mode, the enc provides high-speed po sition tracking, based on the a/b or a/b/z input signals from an incremental encoder. z event (rotation pulse) sensing: programmable to generate an interrupt on each event. z event counter: programmable to generate an interrupt at a preset count (for positional displacement calculation). z direction discrimination z up/down counting (dynamically selectable) z programmable counter period 12.1.2 sensor modes in sensor modes, the enc provides low-speed posi tion (zero-cross) tracking, based on either the a(u)/b(v) or a(u)/b(v)/z(w) input signals from a hall sensor. there are two operating modes: event count mode and timer count mode (which runs with fsys). 12.1.2.1 event count mode z event (rot a tion pulse) sensing: programmable to generate an interrupt on each event. z event counter: programmable to generate an interrupt at a preset count (for positional displacement calculation). z direction discrimination 12.1.2.2 timer count mode z event (rot a tion pulse) sensing: programmable to generate an interrupt on each event. z timer counting operation z direction discrimination z input capture functions event capture (event interval measurem ent): programmable to generate an interrupt. software capture z event timeout error (timer compare): progra mmable to generate an interrupt at a preset count. z revolution error: error flag that i ndicates a change of the rotation direction
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 4 / 23 - 12.1.3 timer mode the enc can serve as a 24-b it general-purpose timer. z 24-bit up-counter z counter clear: via a software clear bit, or at a preset count, or by an external trigger input, or on overflow of the free-running counter. z timer compare: programmable to generate an interrupt at a preset count. z input capture functions external trigger capture: programmable to generate an interrupt. software capture
tmpm380/m382 tmpm380/m382 - 5 / 23 - 12.2 control registers encoder 0 input control register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. 23 22 21 20 19 18 17 16 bit symbol - - - - - mode1 mode0 p3en read/write r r r r r r/w r/w r/w default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. enc operating mode 00: encoder mode 01: sensor event count mode 10: sensor timer count mode 11: timer mode [in sensor mode] 2/3-phase input select 0: 2-phase 1: 3-phase 15 14 13 12 11 10 9 8 bit symbol cmp reverr ud zdet sftcap enclr zesel cmpen read/write r r r r w w r/w r/w default 0 0 0 0 0 0 0 0 description compare flag 0: 1: counter compared this bit is cleared on a read. [in sensor timer count mode] revolution error 0: 1: error occurred. this bit is cleared on a read. rotation direction 0: ccw 1: cw z_ detected 0: not detected 1: z phase detected [in sensor timer count and timer modes] software capture 0: 1: software capture encoder counter clear 0: 1: clears the counter. [in timer mode] z trigger edge select 0: rising edge 1: falling edge compare enable 0: compare disabled 1: compare enabled 7 6 5 4 3 2 1 0 bit symbol zen enrun nr1 nr0 inten endev2 endev1 endev0 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 en0tncr (0x4001_0400) description z phase enable 0: disabled 1: enabled enc run 0: disabled 1: enabled noise filter 00: no filtering 01: filters out pulses narrower than 31/fsys (387.5 ns@80 mhz). 10: filters out pulses narrower than 63/fsys(787.5 ns@80 mhz). 11: filters out pulses narrower than 127/fsys(1587 ns@80 mhz). enc interrupt enable 0: disabled 1: enabled encoder pulse division factor 000: 1 001: 2 010: 4 011: 8 100: 16 101: 32 110: 64 111: 128 description: : enc operating mode 00: encoder mode 01: sensor event count mode 10: sensor timer count mode 11: timer mode selects an operating mode for the enc.
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 6 / 23 - operating modes are defined by , and as shown in the following table. there are a total of eight operating modes. input signal used operating mode 0 a, b encoder mode 0 0 1 0 a, b, z encoder mode (using z) 0 a,b sensor event count mode (2 phase inputs) 0 1 0 1 a, b, z sensor event count mode (3 phase inputs) 0 a, b sensor timer count mode (2 phase inputs) 1 0 0 1 a, b, z sensor timer count mode (3 phase inputs) 0 - timer mode 1 1 1 0 z timer mode (using z) : 2/3-phase input select 0: 2-phase 1: 3-phase selects the number of phase input pins used. if is cleared to 0, the enc decodes two phase inputs. if is set to 1, the enc decodes three phase inputs. in timer mode, this bit has no effect. note: must always be cleared in encoder m ode, irrespective of the number of phase input pins used. : compare flag 0: 1: counter compared is set to 1 when the counter value has been compared to the value programmed in the en0int register. is cleared to 0 on a read. remains cl eared when = 0. writing to has no effect. : revolution error 0: 1: error occurred. in sensor timer count mode, is set to 1 when a change in the rotation direction has been detected. is cleared to 0 on a read. remains cleared when = 0. writing to has no effect. this bit has an effect only in sensor timer count mode. note: once software has changed t he operating mode of the enc, must be cleared by reading it. : rotation direction 0: counterclockwise (ccw) 1: clockwise (cw) the quadrature signals a and b identify the motor rotation direction. is set to 1 when the cw direction is indicated (signal a of the incremental encoder signal is ahead of signal b). is cleared to 0 when the ccw direction is indicated (signal a is behind signal b). remains cleared while = 0.
tmpm380/m382 tmpm380/m382 - 7 / 23 - : z detected 0: not detected 1: detected is set to 1 on the first edge of z input signal (encz) after is written from 0 to 1. this occurs on a rising edge of the signal z during cw rotation or on a falling edge of z during ccw rotation. remains cleared while = 0. has no influence on the value of . remains cleared in sensor even t count and sensor timer count modes. : software capture 0: 1: software capture if is set to 1, the value of the encoder counter is captured into the en0cnt register. writing a 0 to has no effec t. reading always returns a 0. in encoder and sensor event count modes, has no effect; a write of a 1 to this bit is ignored. : encoder counter clear 0: 1: clears the encoder counter. writing a 1 to clears the encoder counter to 0. once cleared, the encoder counter restarts counting from 0. writing a 0 to has no effect. reading always returns a 0. : z trigger edge select 0: uses a rising edge of the encz as an external trigger input. 1: uses a falling edge of the encz as an external trigger input. selects the edge of the encz that should be used as an external trigger in timer mode. in the other operating modes, has no effect. : compare enable 0: compare disabled 1: compare enabled if is set to 1, the value of the encoder c ounter is compared to the value programmed in the en0int register. if is cleared to 0, this comparison is not done. : z phase enable 0: disabled 1: enabled ? ? in encoder mode controls whether to clear the encoder counter (en0cnt) on the rising or falling edge of z. when = 1, the encoder counter is clear ed on the rising edge of the encz input if the motor is rotating in the cw direction; the encode r counter is cleared on the falling edge of encz if the motor is rotating in the ccw direction. if t he edges of enclk (multiply _by_4 clock derived from the decoded a and b signals) and the edge of encz co incide, the encoder counter is cleared to 0 without incrementing or decrementing (i.e., the clear takes precedence).
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 8 / 23 - ? ? in timer mode controls whether to use the encz signal as an external trigger input. when = 1, the value of the encoder coun ter is captured into the en0int register and cleared to 0 on the edge of encz selected by . in the other operating modes, has no effect. : enc run 0: disabled 1: enabled setting to 1 and clearing to 0 enables the encoder operation. clearing to 0 disables the encoder operation. there are counters and flags that ar e and are not cleared even if the bit is cleared to 0. the following table shows the states of the counters and flags, depending on the value of . internal counter / flag when = 0 (after reset) when = 1 (during active operation) when = 0 (during idle mode) how to clear a counter or flag when = 0 encoder counter 0x000000 counting keeps the current value. software clear (write a 1 to .) noise filter counter 0y0000000 counting up counting up (continues with noise filtering.) cleared only by reset. encoder pulse division counter 0x00 counting down stopped and cleared cleared when = 0. compare flag 0 set to 1 upon comparison; cleared to 0 on a read. cleared cleared when = 0. revolution error flag 0 set to 1 upon an error; cleared to 0 on a read. cleared cleared when = 0. z detected flag 0 set to 1 on detection of z. cleared cleared when = 0. rotation direction bit 0 set or cleared according to rotation direction. cleared cleared when = 0. : noise filter 00: no filtering 01: filters out pulses narrower than 31/fsys as noises. 10: filters out pulses narrower than 63/fsys as noises. 11: filters out pulses narrower than 127/fsys as noises. the digital noise filters remove pulses narr ower than the width selected by . : enc interrupt enable 0: disabled 1: enabled enables and disables the enc interrupt. setting to 1 enables interrupt generation. clearing to 0 disables interrupt generation.
tmpm380/m382 tmpm380/m382 - 9 / 23 - : encoder pulse division factor 000: 1 001: 2 010: 4 011: 8 100: 16 101: 32 110: 64 111: 128 the frequency of the encoder pulse is divided by the factor specified by . the divided signal determines the interval of the event interrupt. encoder 0 counter reload register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. 15 14 13 12 11 10 9 8 bit symbol reload15 reload14 reload13 reload12 reload11 reload10 reload9 reload8 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 description (see the description below.) 7 6 5 4 3 2 1 0 bit symbol reload7 reload6 reload5 reload4 reload3 reload2 reload1 reload0 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 en0reload (0x4001_0404) description setting the encoder counter period (multiplied by 4 (or 6)) 0x0000 thru. 0xffff when z is used: specifies the number of counter pulses per revolution. when z is not used: specifies the number of counter pulses per revolution minus 1. description: : setting the encoder counter period ? ? in encoder mode defines the encoder co unter period multiplied by 4. if the encoder counter is configured as an up-c ounter, it increments up to the value programmed in and then wraps around to 0 on the next enclk. if the encoder counter is configured as a down-counter, it decrements to 0 and then is reloaded with the value of on the next enclk. the en0reload register is only used in encoder mode.
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 10 / 23 - encoder 0 compare register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. 23 22 21 20 19 18 17 16 bit symbol int23 in t22 int21 int20 int 19 int18 int17 int16 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 description see the description below. are used only in sensor timer count mode and timer mode 15 14 13 12 11 10 9 8 bit symbol int15 in t14 int13 int12 int1 1 int10 int9 int8 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 description see the description below. 7 6 5 4 3 2 1 0 bit symbol int7 int6 int5 int4 int3 int2 int1 int0 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 en0int (0x4001_0408) description in encoder mode: generates an interrupt at the programmed encoder pulse count (0x0000 thru. 0xffff). in sensor event count mode: generates an interrupt at the programmed encoder pulse count (0x0000 thru. 0xffff). in sensor timer count mode: generates an interrupt when the counter has reached th e programmed value without detecting a pulse (0x000000 thru. 0xffffff). in timer mode: generates an interrupt when the counter value has reached the programmed value (0x000000 thru. 0xffffff). description: : counter compare value ? ? in encoder mode is set to 1 when the value of the encoder counter has reached the value of , provided is set to 1. at this time, the event counter in terrupt (intenc) is asserted if is set to 1. however, when = 1, intenc is not asserted until is set to 1. in encoder mode, are not used (and are ignored even if programmed). ? ? in sensor event count mode is set to 1 when the value of the encoder counter has reached the value of , provided is set to 1. at this time, the interrupt request (intenc) is asserted if is set to 1. the value of has no effect on this interrupt generation. in sensor event count mode, are not used (and are ignored even if programmed). ? ? in sensor timer count mode is set to 1 when the value of the encoder counter has reached the value of , provided is set to 1. this indicates t he absence of a pulse for an abnormally long period. at this time, the interrupt request (intenc) is asserted if is set to 1. the value of has no effect on this interrupt generation. ? ? in timer mode is set to 1 when the value of the encoder counter has reached the value of , provided is set to 1. at this time, the timer compare interrupt (intenc) is asserted if is set to 1. the value of has no effect on this interrupt generation.
tmpm380/m382 tmpm380/m382 - 11 / 23 - encoder 0 counter register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r default 0 0 0 0 0 0 0 0 description reading these bits returns a 0. 23 22 21 20 19 18 17 16 bit symbol cnt23 cnt22 cnt21 cnt20 cnt19 cnt18 cnt17 cnt16 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 description see the description below. are used only in sensor timer count mode and timer mode. in encoder mode and sensor event count mode, reading these bits returns a 0. 15 14 13 12 11 10 9 8 bit symbol cnt15 cnt14 cnt13 cnt12 cnt11 cnt10 cnt9 cnt8 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 description see the description below. 7 6 5 4 3 2 1 0 bit symbol cnt7 cnt6 cnt5 cnt4 cnt3 cnt2 cnt1 cnt0 read/write r/w r/w r/w r/w r/w r/w r/w r/w default 0 0 0 0 0 0 0 0 en0cnt (0x4001_040c description in encoder mode: number of encoder pulses 0x0000 thru. 0xffff in sensor mode: pulse detection time or the encoder counter value captured under software control 0x000000 thru. 0xffffff in timer mode: iencoder counter value captured by hardware signaling or under software control 0x000000 thru. 0xffffff description: : encoder counter/captured value ? ? in encoder mode the value of encoder count.can be read out from . in encoder mode, the encoder counter counts up or down on each encoder pulse (enclk). during cw rotation, encoder counter counts up; when it has reached the value of , it wraps around to 0 on the next enclk. during ccw rotation, encoder counter counts down; wh en it has reached 0, it is reloaded with the value of on the next enclk. ? ? in sensor event count mode the value of encoder count.can be read out from . in sensor event count mode, the encoder count er counts up or down on each encoder pulse (enclk). during cw rotation, encoder counter counts up; when it has reached0xffff, it wraps around to 0 on the next enclk. during ccw rotation, encoder counter counts down ; when it has reached 0, it wraps around to 0xffff on the next enclk.
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 12 / 23 - ? ? in sensor timer count mode contains the value of the encoder counter captured by either the encoder pulse (enclk) or software setting to 1. the captured value in is cleared to 0 on system reset. it can also be cleared by clearing the counter via setting to 1 and then setting to 1. in sensor timer count mode, the encoder counter is configured as a free-running counter that counts up with fsys. the encoder counter is cleared to 0 when the encoder pulse (enclk) is detected. when it has reached 0xffffff, it wraps around to 0 automatically. ? ? in timer mode contains the value of the encoder counter captured by software setting to 1. when = 1, the value of the encoder counter is also captured into on the z encz edge selected by . in timer mode, the encoder counter is configur ed as a free-running counter that counts up with fsys. when it has reached 0xffffff, it wraps around to 0 automatically.
tmpm380/m382 tmpm380/m382 - 13 / 23 - 12.3 functional description 12.3.1 operating modes 12.3.1.1 encoder mode (1) when = 1 ( = 0x0380, = 0x0002) (2) when = 0 ( = 0x0380, = 0x0002) ? ? in encoder mode, the incremental encoder inputs of the tmpm370 should be connected to the a, b and z channels. the encoder counter counts pul ses of enclk, which is multiplied_by_4 clock derived from the decoded a and b quadrature signals. ? ? during cw rotation (i.e., when a leads b), the enc oder counter counts up; when it has reached the value of , it wrap s around to 0 on the next enclk. ? ? during ccw rotation (i.e., when a lags b), the encoder counter counts down; when it has reached 0x0000, it is reloaded with the value of on the next enclk. ? ? additionally, when = 1, the encoder counter is cleared to 0 on the rising edge of z during cw rotation and on the falling edge of z during ccw rotation (at the internal z_detected timing). encoder pulse, enclk encoder input, a encoder input, b encoder counter, encnt 0 rotation direction cw ccw di r encoder input, z internal z_detected ( 2) timpls 113 1 112 111 110 0 1 0 380 37f 37e 37d interrupt, intenc0 37c 2 counter clear, enclr z detect, encoder pulse, enclk encoder input, a fsys encoder input, b encoder counter 0 rotation direction cw ccw di r encoder input, z internal z_detected ( 2) timpls 1 2 112 111 110 0 1 0 380 37e 37d 380 interrupt, intenc0 0 37f 3 counter clear, enclr z detect,
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 14 / 23 - if the enclk and z edges coincide, the encoder counter is cleared to 0 without incrementing or decrementing. ? ? when is set to 1, causing t he encoder counter to be cleared to 0. ? ? is set to 1 during cw rotation and cleared to 0 during ccw rotation. ? ? timpls, which is derived by dividing enclk by a programmed factor, can be driven out externally. ? ? if is set to 1, an interrupt is generat ed when the value of the encoder counter has reached the value of . when = 1, however, an interrupt does not occur while = 0. ? ? clearing to 0 clears and to 0. 12.3.1.2 sensor event count mode (1) when

= 1 ( = 0x0002) (2) when = 0 ( = 0x0002) ? ? in sensor event count mode, the hall sensor in puts of the tmpm370 should be connected to the a(u), b(v) and z(w) channels. the encoder counter counts the pulses of enclk, which is either multiplied_by_4 clock (when = 0) deriv ed from the decoded a(u) and b(v) signals or multiplied_by_6 clock (when = 1) de rived from the decoded a(u), b(v) and z(w) signals. ? ? during cw rotation, the encoder counter counts up; when it has reached 0xffff, it wraps around to 0 on the next enclk. encoder input, a fsys encoder counter rotation direction cw ccw di r encoder input, z ( 2 ) timpl s fffd fffc interrupt, intenc0 fffe 0 ffff 1 3 2 1 2 0 fffe ffff fffd fffc fffb fffa encoder pulse, enclk encoder input, b encoder pulse, enclk encoder input, a fsys encoder input, b encoder counter rotation direction cw ccw di r encoder input, z ( 2) timpls fffd fffc interrupt, intenc0 fffe 0 ffff 1 3 2 1 2 0 fffe ffff fffd fffc fffb fffa
tmpm380/m382 tmpm380/m382 - 15 / 23 - ? ? during ccw rotation, the encoder counter count s down; when it has reached 0x0000, it wraps around to 0xffff on the next enclk. ? ? when is set to 1, causing the internal counter to be cleared to 0. ? ? is set to 1 during cw rotation and cleared to 0 during ccw rotation. ? ? timpls, which is derived by dividing enclk by a programmed factor, can be driven out externally. ? ? if is set to 1, an interrupt is generat ed when the value of the internal counter has reached the value of . ? ? clearing to 0 clears to 0. 12.3.1.3 sensor timer count mode (1) whe n

= 1 ( = 0x0002) (2) when = 0 ( = 0x0002) ? ? in sensor timer count mode, the hall sensor inputs of the tmpm370 should be connected to the a(u), b(v) and z(w) channels . the encoder counter measures the interval between two contiguous pulses of enclk, which is either multiplied_by_4 clock (when = 0) derived from the decoded a(u) and b(v) signals or mu ltiplied_by_6 clock (when = 1) derived from the decoded a(u), b(v) and z(w) signals. ? ? the encoder counter always counts up; it is cleared to 0 on enclk. when the encoder counter encoder pulse, enclk encoder input, a fsys encoder input, b rotation direction cw ccw di r encoder input, z encoder counter ( 2) timpls 3 2 interrupt, intenc0 0 2 1 3 2 1 3 0 1 0 2 3 1 0 3 1 0 2 0 3 2 3 2 0 2 3 0 2 3 0 (ini) 3 2 3 2 capture register, en0cnt revolution error, reverr encoder pulse, enclk encoder input, a fsys encoder input, b encoder counter rotation direction cw ccw di r encoder input, z ( 2) timpls 3 2 interrupt, intenc0 0 2 1 3 2 1 3 0 1 0 2 3 1 0 3 1 0 2 0 3 2 3 2 0 2 3 0 2 capture register, en0cnt 3 0 (ini) 3 2 3 2 revolution error, reverr
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 16 / 23 - has reached 0xffffff, it wraps around to 0. ? ? when is set to 1, causing t he encoder counter to be cleared to 0. ? ? enclk causes the value of the encoder counter to be captured into the en0cnt register. the captured counter value can be read out of en0cnt. ? ? setting the software capture bit, , to 1 causes the value of the encoder counter to be captured into the encnt register. this captur e operation can be performed at any time. the captured counter value can be read out of encnt. ? ? clearing to 0 clears to 0. ? ? if is set to 1, an interrupt is generat ed when the value of the encoder counter has reached the value of . ? ? is set to 1 during cw rotation and cleared to 0 during ccw rotation. ? ? is set to 1 when the rotation direction has changed. this bit is cleared to 0 on a read. ? ? the value of the encnt register (the captured va lue) is retained, regardless of the value of . the encnt register is only cleared by a reset.
tmpm380/m382 tmpm380/m382 - 17 / 23 - 12.3.1.4 timer mode (1) when = 1 ( = 0x0006) (2) when = 0 ( = 0x0006) ? ? when = 1, the z input pin is used as an external trigger. when = 0, no external input is used to trigger the timer. ? ? the encoder counter always counts up. if = 1, the counter is cleared to 0 on the selected edge of z (at the internal z_de tected timing): a rising edge wh en = 0 and a falling edge when = 1. when the encoder counte r has reached 0xffffff, it wraps around to 0. ? ? when is set to 1, causing t he encoder counter to be cleared to 0. ? ? z_detected causes the value of the encoder count er to be captured into the encnt register. the captured counter value can be read out of encnt. ? ? setting the software capture bit, , to 1 causes the value of the encoder counter to be encoder pulse, enclk encoder input, a encoder input, b encoder counter rotation direction cw ccw di r encoder input, z ( 2 ) timpl s 3 2 interrupt, intenc0 4 6 5 7 a 9 b 8 d c e f 10 32 31 33 3534 36 2 1 3 0 5 4 6 7 8 9 a b c d capture register, en0cnt a 0 (ini) a internal z_detected z edge select, zesel counter clear, enclr soft capture sftcap compare interrupt compare interrupt iencoder pulse, enclk encoder input, a encoder input, b encoder counter rotation direction cw ccw di r encoder input, z ( 2 ) timpl s 3 2 interrupt, intenc0 4 6 5 7 a 9 b 8 1 0 2 3 4 32 31 33 3534 36 39 38 40 37 0 41 1 2 3 4 5 6 7 8 capture register, en0cnt b 0 (ini) b 41 internal z_detected z edge select, zesel counter clear, enclr compare interrupt compare interrupt capture interrupt capture interrupt
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 18 / 23 - captured into the encnt register. this captur e operation can be performed at any time. the captured counter value can be read out of encnt. ? ? is set to 1 during cw rotation and cleared to 0 during ccw rotation. ? ? if is set to 1, an interrupt is generat ed when the value of the encoder counter has reached the value of . ? ? clearing to 0 clears to 0. ? ? the value of the encnt register (the captured va lue) is retained, regardless of the value of . the encnt register is only cleared by a reset.
tmpm380/m382 tmpm380/m382 - 19 / 23 - the counter is cleared when it has reached the value of en0int reg 0x0150 (compare register) intenc0 (compare) 14f 150 0 1 0 1 2 3 encoderl counter intenc0 (compare) fffd fffe ffff 0 1 14f 150 151 152 0 1 2 3 encoder counter 2 2 en0int reg 0xffff (compare register) the counter is cleared when it has reached the value of encoder pulse, enclk encoder input, a encoder input, b the counter is cleared when its value has reached the value of . en0int reg 0x0150 (compare register) intenc0 ( com p are ) 14f 150 131 0 0 1 2 3 encode r counte r intenc0 (compare) encoder counter 1 en0int reg 0xffff (compare register) fffd fffe ffff 0 1 151 152 0 1 2 3 2 14f 14c 14e 14d 150 14c 14e 14d enreload reg 0x0151 enreload reg 0xffff the counter is cleared when its value has reached the value of . encoder pulse, enclk intenc0 (compare) fffd fffe ffff 0 1 151 152 0 1 2 3 encoder counter 2 en0int reg 0x0150 (compare register) rotation pulse count the counter wraps around to 0 on overflow. 14f 14c 14e 14d 150 encoder input, a encoder input, b en0int reg 0x0150 (compare register) event timeout period intenc0 ( com p are ) 14f 150 151 152 0 1 2 3 encoder counter intenc0 (compare) fffd fffe ffff 0 1 151 152 0 1 2 3 encoder counter 2 en0int reg 0xffff (compare register) event timeout period the counter wraps around to 0 on overflow. 14c 14e 14d 14f 14c 14e 14d 150 the counter is cleared by a rotation pulse. intenc0 (capture) 1 2 3 4 0 1 2 3 encoder counter 5 9e 0 9f u/v/w encoder pulse, enclk en0int reg 0x0150 (compare register) event timeout period ? no event timeout error ? event timeout error fffd fffe ffff 0 1 2 the counter wraps around to 0 on overflow. intenc0 (compare) 12.3.2 counter operation and interrupt generation when = 1 12.3.2.1 encoder mode 12.3.2.2 sensor event count mo de 12.3.2.3 sensor t imer count mode 12.3.2.4 t i mer mode
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 20 / 23 - encoder pulse, enclk encoder input, a encoder input, b the counter is cleared when its value has reached the value of . en0int reg 0x0150 (compare register) intenc0 (event) 14f 150 151 0 0 1 2 3 encoder counter intenc0 (event) encoder counter 1 en0int reg 0xffff (compare register) fffd fffe ffff 0 1 151 152 0 1 2 3 2 14f 14c 14e 14d 150 14c 14e 14d = 000 enreload reg 0x0151 enreload reg 0xffff the counter is cleared when its value has reached the value of . encoder pulse, enclk intenc0 (event) fffd fffe ffff 0 1 151 152 0 1 2 3 encoder counter 2 en0int reg 0x0150 (compare register) rotation pulse count the counter wraps around to 0 on overflow. 14f 14c 14e 14d 150 encoder input, a encoder input, b = 000 enint reg 0x0150 (compare register) event timeout period intenc0 (compare) 14f 150 151 152 0 1 2 3 encoder counter intenc0 (compare) fffd fffe ffff 0 1 151 152 0 1 2 3 encoder counter 2 enint reg 0xffff (compare register) event timeout period the counter wraps around to 0 on overflow. 14c 14e 14d 14f 14c 14e 14d 150 the counter is cleared by a rotation pulse int enc0 ( c ompare ) 1 2 3 4 0 1 2 3 encoder counter 5 9e 0 9f u/v/w encoder pulse, enclk en0int reg 0x0150 (compare register) event timeout period ? no event timeout error ? event timeout error fffd fffe ffff 0 1 2 the counter wraps around to 0 on overflow. intenc0 (compare) the counter is cleared when it has reached the value of enint reg 0x0150 (compare register) intenc0 ( com p are ) 14f 150 0 1 0 1 2 3 encode counter intenc0 ( com p are ) fffd fffe ffff 0 1 14f 150 151 152 0 1 2 3 encoder ct 2 2 enint reg 0xffff (compare register) the counter is cleared when it has reached the value of 12.3.3 counter operation and interrupt generation when = 0 12.3.3.1 encoder mode 12.3.3.2 sensor event count mo de 12.3.3.3 sensor t imer count mode 12.3.3.4 ti mer mode
tmpm380/m382 tmpm380/m382 - 21 / 23 - 12.3.4 encoder rotation direction the following diagrams illustrate the phase shifting of the a, b and z channels. the enc can interface with both two-phase (a/b ) and three-phase (a/b/z) encoder inputs. for three-phase encoder inputs, should be set to 1. ( 1 ) here are possible combinations of values of the a (u), b (v) and z (w) signals during cw rotation. ? for two-phase inputs ? for three-phase inputs ( 2 ) here are possible combinations of values of the a (u), b (v) and z (w) signals during ccw rotation. ? for two-phase inputs ? for three-phase inputs a b 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 a b z a b 0 0 1 1 0 0 0 1 1 0 0 1 a b z 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1
12 encoder input circuit (enc) tmpm380/m382 tmpm380/m382 - 22 / 23 - 12.3.5 counter block the counter block consists of a 24-bit up/down counter and its control logic. 12.3.5.1 overview the counter is co nfigured as an up-counter or a down-counter, cleared and reloaded with a programmed value, according to the selected operating mode. table 12-4 summa rizes h ow the counter is controlled. table 12-4 counter control operating mode input pins count up/down counter clear conditions counter reload conditions counter range (reload value) up [1] is set to 1. [2] counter= - 0 a, b encoder pulse (enclk) down [1] is set to 1. [1] counter=0x0000 up [1] is set to 1. [2] counter= [3] z trigger - encoder mode 00 1 0 a, b, z encoder pulse (enclk) down [1] is set to 1. [1] counter=0x0000 0x0000 thru. up [1] is set to 1. [2] counter=16?hffff - 0 a, b encoder pulse (enclk) down [1] is set to 1. [1] counter=0x0000 up [1] is set to 1. [2] counter=0xffff - sensor event count mode 01 0 1 a, b, z encoder pulse (enclk) down [1] is set to 1. [1] counter=0x0000 0x0000 thru. 0xffff 0 a, b fsys up sensor timer count mode 10 0 1 a, b, z fsys up [1] is set to 1. [2] counter=0xffffff [3] encoder pulse (enclk) 0x000000 thru. 0xffffff 0 - fsys up [1] is set to 1. [2] counter=0xffffff [3] counter= timer mode 11 1 x z fsys up [1] is set to 1. [2] counter=0xffffff [3] counter= [4] z trigger 0x000000 thru. 0xffffff note: clearing to 0 does not clear the counter. setting to 1 again causes the count er to restart from the current count. the counter should be cleared by software setting to 1.
tmpm380/m382 tmpm380/m382 - 23 / 23 - 12.3.6 interrupts the enc has these interrupts: event (divided-clock/ capture) interrupt, event timeout interrupt, timer compare interrupt and capture interrupt. 12.3.6.1 overview when = 1, the enc g enerates interrupt requests, based on the counter value and the detection of a encoder pulse. there are six interrupt sour ces, depending on the operating mode, and the settings of and , as shown in table 12-5 . t able 12 -5 interru pt sources interrupt source description operating mode interrupt generation status flag 1 event counter interrupt when = 1, the encoderl counter counts events (encoder pulses). when it has reached the value programmed in , an interrupt occurs. when = 1 and = 1 2 event interrupt (divided clock pulse) an interrupt occurs on each divided clock pulse, which is derived by dividing the encoder pulse by a factor programmed in . encoder mode and sensor event count modes when = 1 none 3 event interrupt (capture interrupt) an interrupt occurs to indicate that an event (encoder pulse) has occurred, causing the counter value to be captured. when = 1 none 4 event timeout interrupt when = 1, the enc uses a counter that counts up with fsys and is cleared by an event (encoder pulse). if no event occurs for a period of time programmed in , an interrupt occurs. sensor timer count mode when = 1 and = 1 5 timer compare interrupt when = 1, an interrupt occurs when the timer has reached the value programmed in . when = 1 and = 1 6 capture interrupt an interrupt occurs when the counter value has been captured on an external trigger (z input). timer mode when = 1 none in sensor timer count mode and timer mode, the value of the encoder counter can be captured into the encnt register. the captured counter value can be read out of the encnt register. in sensor timer count mode, the value of t he encoder counter is captured into the encnt register upon occurrence of an event (encoder pulse). the counter value can also be captured by writing a 1 to . in timer mode, the counter value can be captur ed by writing a 1 to . if is set to 1, the counter value can also be captured by an edge of the z signal input selected via .
tmpm380/m382 tmpm380/m382 - 1 / 52 - 13 serial channel (uart/sio) 13.1 features this device has five serial i/o channels: sio0 to sio4. each channel operates in either the uart mode (asynchronous communication) or the i/o interface mode (synchronous communication) which is selected by the user. i/o interface mode mode 0: this is the mode to transmit and receive i/o data and associated synchronization signals (sclk) to extend i/o. mode 1: tx/rx data length: 7 bits asynchronous (uart) mode: mode 2: tx/rx data length: 8 bits mode 3: tx/rx data length: 9 bits in the above modes 1 and 2, parity bits can be added. the mode 3 has a wakeup function in which the master controller can start up slave controllers via the serial link (multi-controller system). fig 13-2 sh ows the blo ck diagram of sio0. each channel consists of a prescaler, a serial clock generation circuit, a receive buffer, its control circuit, a transmit buffer and its control circuit. each channel functions independently. as the sios 0 to 4 operate in the same way, only sio0 is described here. table 13-1 difference in the specifications of sio modules channel 0 channel 1 channel 2 channel 3 channel 4 pin name txd0 (pe0) rxd0 (pe1) cts0 /sclk0 (pe2) txd1 (pa5) rxd1 (pa6) cts1 /sclk1 (pa4) txd2 (pd5) rxd2 (pd6) cts2 /sclk2 (pd4) txd3 (pf3) rxd3 (pf4) cts3 /sclk3 (pf2) txd4 (pc6) rxd4(pc7) cts4 /sclk4 (pc5) interrupt intrx0 inttx0 intrx1 inttx1 intrx2 inttx2 intrx3 inttx3 intrx4 inttx4 in the uart mode, tmrb output to use for the serial transfer clock tb4out (tmrb4) tb4out (tmrb4) tb7out (tmrb7) tb7out (tmrb7) mttb0out (mpt0) enable register sc0en 0x4002_0080 sc1en 0x4002_00c0 sc2en 0x4002_0100 sc3en 0x4002_0140 sc4en 0x4002_0180 transmit/ receive register sc0buf 0x4002_0084 sc1buf 0x4002_00c4 sc2buf 0x4002_0104 sc3buf 0x4002_0144 sc4buf 0x4002_0184 control register sc0cr 0x4002_0088 sc1cr 0x4002_00c8 sc2cr 0x4002_0108 sc3cr 0x4002_0148 sc4cr 0x4002_0188 mode control register 0 sc0mod0 0x4002_008c sc1mod0 0x4002_00cc sc2mod0 0x4002_010c sc3mod0 0x4002_014c sc4mod0 0x4002_018c register name (address) baud rate generator control sc0brcr 0x4002_0090 sc1brcr 0x4002_00d0 sc2brcr 0x4002_0110 sc3brcr 0x4002_0150 sc4brcr 0x4002_0190 important tmpm382 (64-pin version) does not implement sio2 and sio3. please do not use these functions if you use this product.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 2 / 52 - channel 0 channel 1 channel 2 channel 3 channel 4 baud rate generator control 2 sc0bradd 0x4002_0094 sc1bradd 0x4002_00d4 sc2bradd 0x4002_0114 sc3bradd 0x4002_0154 sc4bradd 0x4002_0194 mode control register 1 sc0mod1 0x4002_0098 sc1mod1 0x4002_00d8 sc2mod1 0x4002_0118 sc3mod1 0x4002_0158 sc4mod1 0x4002_0198 mode control register 2 sc0mod2 0x4002_009c sc1mod2 0x4002_00dc sc2mod2 0x4002_011c sc3mod2 0x4002_015c sc4mod2 0x4002_019c receive fifo configuration register sc0rfc 0x4002_00a0 sc1rfc 0x4002_00e0 sc2rfc 0x4002_0120 sc3rfc 0x4002_0160 sc4rfc 0x4002_01a0 transmit fifo configuration register sc0tfc 0x4002_00a4 sc1tfc 0x4002_00e4 sc2tfc 0x4002_0124 sc3tfc 0x4002_0164 sc4tfc 0x4002_01a4 receive fifo status register sc0rst 0x4002_00a8 sc1rst 0x4002_00e8 sc2rst 0x4002_0128 sc3rst 0x4002_0168 sc4rst 0x4002_01a8 transmit fifo status register sc0tst 0x4002_00ac sc1tst 0x4002_00ec sc2tst 0x4002_012c sc3tst 0x4002_016c sc4tst 0x4002_01ac f ifo configuratio n register sc0fcnf 0x4002_00b0 sc1fcnf 0x4002_00f0 sc2fcnf 0x4002_0130 sc3fcnf 0x4002_0130 sc4fcnf 0x4002_01b0 bit 0 1 2 3 4 5 6 start stop bit 0 1 2 3 4 5 6 start stop parity bit 0 1 2 3 4 5 6 bit 0 1 2 3 4 5 6 start stop start stop parity 7 7 7 bit 0 1 2 3 4 5 6 start 8 7 stop bit 0 1 2 3 4 5 6 start stop(wake-up) bit 8 7 iif bit 8=1, r epr esents address (select code) iif bit 8=0, r epr esents data. ? mode 0 (i/o interface mode) /msb first transmission direction ? mode 1 (7 bits uart mode) ? mode 2 ( 8 bits uart mode) ? mode 3 ( 9 bits uart mode) w ithout parity with parity w ithout parity with parity 0 bit 7 6 5 4 3 2 1 ? mode 0 (i/o interface mode) /lsb first transmission direction 7 bit 0 1 2 3 4 5 6 fig 13-1 data format
tmpm380/m382 tmpm380/m382 - 3 / 52 - 13.2 block diagram (channel 0) fig 13-2 sio0 block diagram sc0mod0 uart mode prescaler tb4out (from tmrb4) 16 32 64 8 4 2 t1 t4 t16 t0 sc0brcr sc0bradd selector selector selector divider t1 t4 t16 t64 sc0brcr f sys i/o interface mode 2 selector i/o interface mode sc0cr sc0mod0 receive counter ( 16 only with uart) serial channel interrupt control transmit counter ( 16 only with uart) transmit control receive control receive shift register rb8 receive buffer (sc0buf) error flag sc0mod0 tb8 transmit buffer (sc0buf) interrupt re q uest intrx0 internal data bus sc0cr txd0 (shared with pe0) 0cts (shared with pe2) internal data bus interrupt request inttx0 sc0mod0 rxd0 (shared with pe1) sc0cr txdclk sc0mod0 parity control internal data bus s er i a l c l oc k generat i on c i rcu i t sclk0 input (shared with pe2) sclk0 output (shared with pe2) baud rate generator rxdclk sioclk sc0brcr 128 t64 transmit shift register fifo control fifo control
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 4 / 52 - 13.3 operation of each circuit (channel 0) 13.3.1 prescaler the device includes a 7-bit prescaler to generat e necessary clocks to drive sio0. the input clock t0 to the prescaler is selected by cgsyscr1 of cg to provide the frequency of either fperiph/1, fperiph/2, f periph/4, fperiph/8, fperiph/16 or fperiph/32. the clock frequen cy fperiph is either t he clock ?fgear,? to be sele cted by cgsyscr1 of cg, or the clock ?fc? before it is divided by the clock gear. the prescaler becomes active only when the baud rate generator is selected for generating the serial transfer clock. table 13-1 list the p r escaler output clock resolution.
tmpm380/m382 tmpm380/m382 - 5 / 52 - table 13-2 clock resolution to the baud rate generator @ = 40mhz prescaler output clock resolution peripheral clock select clock gear value prescaler clock selection t1 t4 t16 t64 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 001(fperiph/2) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 010(fperiph/4) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 011(fperiph/8) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 100(fperiph/16) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 100(fc/2) 101(fperiph/32) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 011(fperiph/8) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 100(fperiph/16) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) 101(fc/4) 101(fperiph/32) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) fc/2 14 (409.6 s) 000(fperiph/1) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 001(fperiph/2) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 010(fperiph/4) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 011(fperiph/8) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) 100(fperiph/16) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) fc/2 14 (409.6 s) 0 (fgear) 110(fc/8) 101(fperiph/32) fc/2 9 (12.8 s) fc/2 11 (51.2 s) fc/2 13 (204.8 s) fc/2 15 (819.2 s) 000(fperiph/1) fc/2 1 (0.05 s) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 000 (fc) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 2 (0.1 s) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 100(fc/2) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 3 (0.2 s) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 101(fc/4) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s) 000(fperiph/1) fc/2 5 (0.8 s) fc/2 7 (3.2 s) 001(fperiph/2) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) 010(fperiph/4) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) 011(fperiph/8) fc/2 4 (0.4 s) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) 100(fperiph/16) fc/2 5 (0.8 s) fc/2 7 (3.2 s) fc/2 9 (12.8 s) fc/2 11 (51.2 s) 1 (fc) 110(fc/8) 101(fperiph/32) fc/2 6 (1.6 s) fc/2 8 (6.4 s) fc/2 10 (25.6 s) fc/2 12 (102.4 s)
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 6 / 52 - (note 1) the prescaler output clock tn must be selected so that the relationship ? tn < fsys: clock gear clock, one of fc,fc/2,fc/4,fc/8,fc/16? is satisfied (so that tn is slower than fsys). (note 2) do not change the clock gear while sio is operating. (note 3) the horizontal lines in the above table indicate that the setting is prohibited. the serial interface baud rate generator uses four different clocks, i.e., t1, t4, t16 and t64, supplied from the prescaler output clock.
tmpm380/m382 tmpm380/m382 - 7 / 52 - 13.3.2 baud rate generator the baud rate generator generates transmit and receive clocks to determine the serial channel transfer rate. the baud rate generator uses either the t1, t4, t16 or t64 clock supplied from the 7-bit prescaler. this input clock selection is made by setting the baud rate generator control register, sc0brcr . the baud rate generator contains built-in divi ders for divide by 1, n + m/16 (n=2~15, m=0~15), and 16. the division is performed according to the settings of the baud rate generator control registers sc0brcr and sc0bradd to determine the resulting transfer rate. the highest baud rate of each mode is limited. ? uart mode 1) if sc0brcr = 0, the setting of sc0bradd is ig nored and the counter is divided by n where n is the value set to sc0b rcr . (n = 1 to 16). 2) if sc0brcr = 1, the n + (16 - k)/16 division function is enabled and the division is made by using the values n (set in sc0brcr ) and k (set in sc0bradd). (n = 2 to 15, k = 1 to 15) (note) for the n values of 1 and 16, the above n+(16-k)/16 division function is inhibited. so, be sure to set sc0brcr to ?0.? ? i/o interface mode the n + (16 - k)/16 division function cannot be used in the i/o interface mode. be sure to divide by n, by setting sc0brcr to ?0?. ? baud rate calculation to use the baud rate generator: 1) uart mode baud rate = ratio divide by the divided frequency clockinput generator rated baud /16 the highest baud rate out of the baud rate generator is 1.25 mbps. the fsys frequency, which is independent of the baud rate generator, can be used as the serial clock. in this case, the highest baud rate will be 2.5 mbps. 2) i/o interface mode baud rate = ratio divide by the divided frequency clockinput generator rated baud /2 when it uses a double buffer, the highest baud rate generated with the baud rate generator becomes 10mbps. (if double buffering is not used, the highest baud rate will be 5.0 mbps).
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 8 / 52 - ? example baud rate setting: 1) division by an integer (divide by n): selecting fc = 39.321 mhz for fperiph, setting t0 to fperiph/16, using the baud rate generator input clock t1, setting the divide ratio n (sc0brcr) = 4, and setting sc0brcr = ?0,? the resulting baud rate in the uart mode is calculated as follows: * clocking conditions system clock : high-speed (fc) high speed clock gear : x 1 (fc) prescaler clock : f periph /16 (f periph = f sys ) baud rate = 4 fc/32 /16 = 39.321 10 6 32 4 16  19200 (bps) (note) the divide by (n + (16-k)/16) function is inhibited and thus sc0bradd is ignored. 2) for divide by n + (16-k)/16 (only for uart mode): selecting fc = 9.6 mhz for fperiph, setting t0 to fperiph/8, using the baud rate generator input clock t1, setting the divide ratio n (sc0brcr) = 7, setting k (sc0bradd) = 3, and selecting sc0brcr< br0adde> = 1, the resulting baud rate is calculated as follows: * clocking conditions system clock : high-speed (fc) high-speed clock gear : x 1 (fc) prescaler clock : f periph /4 (f periph = f sys ) baud rate = 16 3) -(16 7 fc/16 + /16 = 9.6 10 6 16 ( 7 + ) 16 = 4800 (bps) also, an external clock input may be used as the serial clock. the resulting baud rate calculation is shown below: 13 16
tmpm380/m382 tmpm380/m382 - 9 / 52 - ? baud rate calculation for an external clock input: 1) uart mode baud rate = external clock input / 16 the period of the external clock input mu st be equal to or greater than 2/fsys. and it is neccesary to set the highest baud rate less than 1.25 (mbps). 2) i/o interface mode baud rate = external clock input when double buffering is used, it is necess ary to satisfy the following relationship: external clock input period > 6/fsys moreover, it is necessary to adjust the highest baud rate to less than 6.66 (mbps). when double buffering is not used, it is neces sary to satisfy the following relationship: external clock input period > 8/fsys moreover, it is necessary to adjust the highest baud rate to less than 5.0 (mbps). the baud rate examples for the uart mode are shown in table 13-3 and table 13-4 .
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 10 / 52 - table 13-3 selection of uart baud rate (using the baud rate generator with sc0brcr = 0) fc [mhz] input clock divide ratio n (set to sc0brcr ) t1 (fc/4) t4 (fc/16) t16 (fc/64) t64 (fc/256) 9.830400 2 76.800 19.200 4.800 1.200 4 38.400 9.600 2.400 0.600 8 19.200 4.800 1.200 0.300 0 9.600 2.400 0.600 0.150 (note) this table shows the case where the system clock is set to fc, the clock gear is set to fc/1, and the prescaler clock is set to f periph /2. table 13-4 selection of uart baud rate (the tmrb4 timer output (internal tb4out) is used with the timer input clock set to t1.) fc tb4rg0 40 mhz 9.8304 mhz 8 mhz 0x0001 312.5 76.8 62.5 0x0002 156.25 38.4 31.25 0x0003 25.6 0x0004 78.125 19.2 15.625 0x0005 62.5 15.36 12.5 0x0006 12.8 0x0008 39.0625 9.6 0x000a 31.25 7.68 6.25 0x0010 19.53125 4.8 0x0014 15.625 3.84 3.125 baud rate calculation to use the tmrb4 timer: (note 1) in the i/o interface mode, the tmrb4 timer output signal cannot be used internally as the transfer clock. (note 2) this table shows the case where the system clock is set to fc, the clock gear is set to fc, and the prescaler clock is set to f periph /2. transfer rate = clock frequency selected by cgsyscr0 (tbxrg02)2 16 (when input clock to the timer tmrb4 is t1) unit: (kbps) unit: (kbbs) one clock c y cle is a p eriod that the timer fli p -flo p
tmpm380/m382 tmpm380/m382 - 11 / 52 - 13.3.3 serial clock generation circuit this circuit generates basic transmit and receive clocks. ? i/o interface mode in the sclk output mode with the sc0cr serial control register set to ?0,? the output of the previously mentioned baud rate generator is divided by 2 to generate the basic clock. in the sclk input mode with sc0cr set to ?1,? rising and falling edges are detected according to the sc0cr setting to generate the basic clock. ? asynchronous (uart) mode : according to the settings of the serial control mode register sc0mod0 , either the clock from the baud rate register, the system clock (f sys ), the internal output signal of the tmrb4 timer, or the external clock (sclko pin) is selected to generate the basic clock, sioclk. 13.3.4 receive counter the receive counter is a 4-bit binary counter used in the asynchronous (uart) mode and is up-counted by sioclk. sixteen sioclk clock pulses are used in receiving a single data bit while the data symbol is sampled at the sevent h, eighth, and ninth pulses. from these three samples, majority logic is applied to decide the received data. 13.3.5 receive control unit ? i/o interface mode: in the sclk output mode with sc0cr set to ?0,? the rxd0 pin is sampled on the rising edge of the shift clock output to the sclk0 pin. in the sclk input mode with sc0cr set to ?1,? the serial receive data rxd0 pin is sampled on the rising or falling edge of sclk input depending on the sc0cr setting. ? asynchronous (uart) mode: the receive control unit has a start bit detection circuit, which is used to initiate receive operation when a normal start bit is detected. 13.3.6 receive buffer the receive buffer is of a dual structure to prevent overrun errors. the receive shift register stores the received data bit-by-bit. when a co mplete set of bits have been stored, they are moved to the receive buffer (sc0buf). at the same time, the receive buffer full flag (sc0mod2 ?rbfll?) is set to ?1? to indicate that valid data is stored in the receive buffer. however, if the receive fifo is set enabled, t he receive data is moved to the receive fifo and this flag is immediately cleared. if the receive fifo has been disabled (scofcnf = 0 and sc0mod1 =01), the intrx0 interrupt is generated at the same time. if the receive fifo has been enabled (scnfcnf = 1 and sc0mod1 = 01), an interrupt will be generated according to the sc0rfc setting.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 12 / 52 - the cpu will read the data from either the receive buffer (sc0buf) or from the receive fifo (the address is the same as that of t he receive buffer). if the receive fifo has not been enabled, the receive buffer full flag is cleared to ?0? by the read operation. the next data received can be stored in the rece ive shift register even if the cpu has not read the previous data from the receiv e buffer (sc0buf) or the receive fifo. if sclk is set to generate clock output in t he i/o interface mode, the double buffer control bit sc0mod2 can be programmed to enable or disable the operation of the receive buffer (scobuf). by disabling the receive buffer (i.e., the double buffer function) and also disabling the receive fifo (scofcnf = 0 and = 01), handshaking with the other side of communication can be enabled and the sclk output stops each time one frame of data is transferred. in this setting, the cpu reads data from the receive shift register. by the read operation of cpu, the sclk output resumes. if the receive buffer (i.e., double buffering) is enabled but the receive fifo is not enabled, the sclk output is stopped when the first receive data is moved from the receive shift register to the receive buffer and the next data is stored in the first buffer filling both buffers with valid data. when the receive buffer is read, the data of the receive shift register is moved to the receive buffer and the sclk output is resumed upon generation of the ? receive interrupt intrx0. therefore, no buffe r overrun error will be caused in the i/o interface sclk output mode rega rdless of the setting of the double buffer control bit sc0mod2 . if the receive buffer (double buffering) is enabled and the receive fifo is also enabled (scnfcnf = 1 and = 01/ 11), the sclk output will be stopped when the receive fifo is full (according to the setting of scofncf ) and receive buffer and receive shift register contain valid data. also in this case, if scofcnf has been set to ?1,? the receive control bit rxe will be automatically cleared upon suspension of the sclk output. if it is set to ?0,? automatic clearing will not be performed. (note) in this mode, the sc0cr flag is insignificant and the operation is undefined. therefore, before switching from the sclk output mode to another mode, the sc0cr register must be read to initialize this flag. in other operating modes, the operation of the receive buffer is always valid, thus improving the performance of continuous data transfer. if the receive fifo is not enabled, an overrun error occurs when the data in the receiv e buffer (sc0buf) has not been read before the receive shift register is full with the next rece ive data. if an overrun error occurs, data in the receive shift register will be lost while data in the receive buffer and the contents of sc0cr remain intact. if the receive fifo is enabled, the fifo must be read before the fifo is full and the receive buffer is written by the next data through receive shift register. otherwise, an overrun error will be generated and the receive fifo overrun error flag will be set. even in this case, the data already in the receive fifo remains intact. the parity bit to be added in the 8-bit uart mode as well as the most significant bit in the 9-bit uart mode will be stored in sc0cr . in the 9-bit uart mode, the slave controlle r can be operated in the wake-up mode by setting the wake-up function sc0mod0 to ?1 .? in this case, the interrupt intrx0 will be generated only when sc0cr is set to ?1.?
tmpm380/m382 tmpm380/m382 - 13 / 52 - 13.3.7 receive fifo buffer in addition to the double buffer function alr eady described, data may be stored using the receive fifo buffer. by setting of the sc0fcnf register and of the sc0mod1 register, the 4-byte receive buffer can be enabled. also, in the uart mode or i/o interface mode, data may be stored up to a pr edefined fill level. when the receive fifo buffer is to be used, be sure to enable the double buffer function. if data with parity bit is to be received in t he uart mode, parity check must be performed each time a data frame is received.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 14 / 52 - 13.3.8 receive fifo operation when fifo is enabled, the received data is moved from receive buffer to receive fifo and the receive buffer full flag is cleared immediatel y. an interrupt will be generated according to the scxrfc setting. note: when the data with parity bit are received in uart mode by using the fifo, the parity error flag is shown the occurring the parity error in the received data. c i/o interface mode with sclk output: the following example describes the case a 4-by te data stream is received in the half duplex mode: scxmod1<6:5>=01 : transfer mode is set to half duplex mode sc0fcnf <4:0>=10111: automatically inhibits co ntinued reception after reaching the fill level. the number of bytes to be used in the receive fifo is the same as the interrupt generation fill level. sc0rfc<1:0>=00: the fill level of fifo in which generated receive interrupt is set to 4-byte.. sc0rfc<7:6>=11: clears receive fifo and sets the condition of interrupt generation. in this condition, 4-byte data reception may be initiated by setting the half duplex transmission mode and writing ?1? to the rxe bit. after receiving 4 bytes, the rxe bit is automatically cleared and the receive operation is stopped (sclk is stopped). fig 13-3 receive fifo operation (1) receive fifo ?? first stage second stage ??? third stage forth stage data3 data4 sc0mod2 sc0mod0 receive interrupt (intrx0) data2 data1 data3 data4 data2 data1 data3 data4 data2 data1 data3 data2 data1 data1 data2 data1 receive shift register receive buffer
tmpm380/m382 tmpm380/m382 - 15 / 52 - d i/o interface mode with sclk input: the following example describes the case a 4-byte data stream is received: sc0mod1 <6:5> = 01: transfer mode is set to half duplex mode sc0fcnf <4:0> = 10101: automatically allows continued reception after reaching the fill level. the number of bytes to be used in the receive fifo is the maximum. sc0rfc <1:0> = 00: the fill level of fifo in whic h generated receive interrupt is set to 4-byte.. sc0rfc <7:6> = 10: clears receive fifo and sets the condition of interrupt generation the number of bytes to be used in the receive fifo is the maximum allowable number. in this condition, 4-byte data reception may be initiated by setting the half duplex transmission mode and writing ?1? to the rxe bit. after receivin g 4 bytes, receive fifo interrupt is generated. this setting enables the next data reception as well. the next 4 bytes can be received before all the data is read from fifo. fig 13-4 receive fifo operation (2) receive fifo ?? first stage second stage ??? third stage forth stage data3 data4 sc0mod2 sc0mod0 receive interrupt (intrx0) data2 data1 data3 data4 data2 data1 data3 data4 data2 data1 data3 data2 data1 data1 data2 data1 receive shift register receive buffer
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 16 / 52 - 13.3.9 transmit counter the transmit counter is a 4-bit binary counter used in the asynchronous communication (uart) mode. it is counted by sioclk as in the case of the ? receive counter and generates a transmit clock (txdclk) on every 16th clock pulse. fig 13-5 transmit clock generation 13.3.10 transmit control unit ? i/o interface mode: in the sclk output mode with sc 0cr set to ?0,? each bit of data in the transmit buffer is output to the txd0 pin on the falling edge of the shift clock output from the sclk0 pin. in the sclk input mode with sc0cr set to ?1,? each bit of data in the transmit buffer is output to the txd0 pin on the rising or falling edge of the input sclk signal according to the sc0cr setting. ? asynchronous (uart) mode: when the cpu writes data to the transmit buffer, data transmission is initiated on the rising edge of the next txdclk and the transmit shift clock (txdsft) is also generated. sioclk txdclk 15 16 1 2 4 5 67 8 910 11 12 13 14 15 16 3 1 2
tmpm380/m382 tmpm380/m382 - 17 / 52 - ? handshake function the cts pin enables frame by frame data transmi ssion so that overrun errors can be prevented. this function can be enabled or disabled by sc0mod0 . when the 0cts pin is set to the ?h? level, the cu rrent data transmission can be completed but the next data transmission is suspended until the 0cts pin returns to the ?l? level. however in this case, the inttx0 interrupt is generated, the next trans mit data is requested to the cpu, data is written to the transmit buffe r, and it waits until it is ready to transmit data. although no rts pin is provided, a handshake control function can be easily implemented by assigning a port for the rts function. by setting the port to ?h? level upon completion of data reception (in the receive interrupt routine), the transmit side can be requested to suspend data transmission. fig 13-6 handshake function fig 13-7 cts (clear to transmit) signal timing (note 1) (note 2) if the cts signal is set to ?h? during transmission, the next data transmission is suspended after the current transmission is completed. data transmission starts on the first falling edge of the txdclk clock after cts is set to ?l.? rxd rts (any port) receive side transmit side txd cts cts ?? ?? 13 14 15 16 1 2 3 14 15 16 1 2 3 sioclk txdclk txd bit 0 start bit transmission is suspended during this period data write timing to transmit buffer or shift register
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 18 / 52 - 13.3.11 transmit buffer the transmit buffer (sc0buf) is in a dual structure. the double buffering function may be enabled or disabled by setting the double buffer control bit in serial mode control register 2 (sc0mod2). if double buffering is enabled, data written to transmit buffer (scobuf) is moved to tr ansmit shift register. if the transmit fifo has been disabled (scofcnf = 0 or 1 and sc0mod1 fdpx1:0 01), the inttx0 interrupt is generated at the same time and the transmit buffer empty flag of sc0mod2 is set to ?1.? this flag indicates that transmit buffer is now empty and that the next transmit data can be written. when the next data is written to transmit buffer, the flag is cleared to ?0.? if the transmit fifo has been enabled (scnfcnf = 1 and sc0mod1 fdpx1:0 10/11), any data in the transmit fifo is moved to the transmit buffer and flag is immediately cleared to ?0.? the cpu writes data to transmit buffer or to the transmit fifo. if the transmit fifo is disabled in the i/o interface sclk input mode and if no data is set in transmit buffer before the next frame clock input, which occurs upon completion of data transmission from transmit shift register, an under-run error occurs and a serial control register (sc0cr) par ity/under-run flag is set. if the transmit fifo is enabled in the i/o interface sclk input mode, when data transmission from transmit shift register is completed, the transmit buffer data is moved to transmit shift register and any data in transmi t fifo is moved to transmit buffer at the same time. if the transmit fifo is disabled in the i/o interface sclk output mode, when data in transmit buffer is moved to transmit shift register and the data transmission is completed, the sclk output stops. so, no under-run errors can be generated. if the transmit fifo is enabled in the i/o in terface sclk output mode, the sclk output stops upon completion of data transmission from tr ansmit shift register if there is no valid data in the transmit fifo. note) in the i/o interface sclk output mode, the sc0cr flag is insignificant. in this case, the operation is undefined. therefore, to switch from the sclk output mode to another mode, sc0cr must be read in advance to initialize the flag. if double buffering is disabled, the cpu writes data only to transmit shift register and the transmit interrupt inttx0 is generated upon completion of data transmission. if handshaking with the other side is necessary , set the double buffer control bit to ?0? (disable) to disable transmit buffer; any setting for the transmit fifo should not be performed.
tmpm380/m382 tmpm380/m382 - 19 / 52 - 13.3.12 transmit fifo buffer in addition to the double buffer function already described, data may be stored using the transmit fifo buffer. by setting of the sc0fcnf register and of the sc0mod1 register, the 4-byte transmit buffe r can be enabled. in the uart mode or i/o interface mode, up to 4 bytes of data may be stored. if data is to be transmitted with a parity bit in the uart mode, parity check must be performed on the receive side each time a data frame is received.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 20 / 52 - 13.3.13 transmit fifo operation when fifo is enabled, the maximum 5-byte data can be stored using the transmit buffer and fifo. once transmission is enabled, data is trans ferred to the transmit shift register from the transmit buffer and start transmission. if data ex ists in the fifo, the data is moved to the transmit buffer immediately, and the flag is cleared to "0". note: to use tx fifo buffer, tx fifo must be cleared after setting the sio transfer mode (half duplex/full duplex) and enabling fifo (scxfcnf = "1"). c i/o interface mode with sclk output (normal mode): the following example describes the case a 4-byte data stream is transmitted: scxmod1<6:5> 10 : transfer mode is set to half duplex. scxfcnf<4:0> 01011 : transmission is automat ically disabled if fifo becomes empty. the number of bytes to be used in the receive fifo is the same as the interrupt generation fill level. scxtfc<1:0> 00 : sets the interrupt generation fill level to "0". scxtfc<7:6> 11 : clears receive fifo and sets the condition of interrupt generation. in this condition, data transmission can be init iated by setting the transfer mode to half duplex, writing 5 bytes of data to the transmit fifo, and setting the sc0mod1 bit to ?1.? when the last transmit data is mov ed to the transmit buffer, the transmit fifo interrupt is generated. when transmission of the last data is completed, the clock is stopped and the transmission sequence is terminated. fig 13-8 transmit fifo operation(1) transmit shift register transmit buffer transmit fifo forth stage third stage second stage first stage 
    ? 
  ? data5 data4 data3 data2 data1 data5 data4 data3 data2 data1 data5 data4 data3 data2 data5 data4 data3 data5 data4 data5 transmit interrupt ( e
tmpm380/m382 tmpm380/m382 - 21 / 52 - d i/o interface mode with sclk input (normal mode): the following example describes the case a 4-byte data stream is transmitted: scxmod1<6:5> 10 : transfer mode is set to half duplex. scxfcnf<4:0> 01011 : transmission is automat ically disabled if fifo becomes empty. the number of bytes to be used in the receive fifo is the same as the interrupt generation fill level. scxtfc<1:0> 00 : sets the interrupt generation fill level to "0". scxtfc<7:6> 11 : clears receive fifo and sets the condition of interrupt generation. in this condition, data transmission can be init iated along with the input clock by setting the transfer mode to half duplex, writing 5 byte s of data to the transmit fifo, and setting the bit to ?1.? when the last transmit data is moved to the transmit buffer, the transmit fifo interrupt is generated. fig 13-9 transmit fifo operation(2) transmit shift register transmit buffer transmit fifo forth stage third stage second stage first stage 
    ? 
  ? data5 data4 data3 data2 data1 data5 data4 data3 data2 data1 data5 data4 data3 data2 data5 data4 data3 data5 data4 data5 transmit interrupt ( e
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 22 / 52 - 13.3.14 parity control circuit if the parity addition bit of the serial control register sc0cr is set to ?1,? data is sent with the parity bit. note that the parity bit may be used only in the 7- or 8-bit uart mode. the bit of sc0cr select s either even or odd parity. upon data transmission, the parity control circ uit automatically generates the parity with the data written to the transmit buffer (sc0buf). a fter data transmission is complete, the parity bit will be stored in sc0buf bit 7 in the 7-bit uart mode and in bit 7 in the serial mode control register sc0mod in the 8-bit uart mode. the and settings must be completed before data is written to the transmit buffer. upon data reception, the parity bit for the re ceived data is automatically generated while the data is shifted to receive shift register and mo ved to receive buffer (sc0buf). in the 7-bit uart mode, the parity generated is compared with the parity stored in sc0buf , while in the 8-bit uart mode, it is compared with the bit 7 of the sc0cr register. if there is any difference, a parity error occurs and the flag of the sc0cr register is set. in use of the fifo, indicates that a parity error was generated in one of the recieved data. in the i/o interface mode, the sc0cr flag functions as an under-run error flag, not as a parity flag. 13.3.15 error flag three error flags are provided to inpr ove the reliability of received data. 1. overrun error : bit 4 of the serial control register sc0cr in both uart and i/o interface modes, this bit is set to ?1? when an error is generated by completing the reception of the next frame receive data before the receive buffer has been read. if the receive fifo is enabl ed, the received data is automatically moved to the receive fifo and no overr un error will be generated until the receive fifo is full (or until the usable bytes are fully o ccupied). this flag is set to ?0? when it is read. in the i/o interface sclk output mode, no overrun error is generated and therefore, this flag is inoperative and the operation is undefined. note: to switch the i/o interface sclk output mo de to other modes, read the scxcr register and clear the overrun flag.
tmpm380/m382 tmpm380/m382 - 23 / 52 - 2. parity error/under-run error < perr>: bit 3 of the sc0cr register in the uart mode, this bit is set to ?1? when a parity error is generat ed. a parity error is generated when the parity generated from the re ceived data is different from the parity received. this flag is set to ?0? when it is read. in the i/o interface mode, this bit indica tes an under-run error. when the double buffer control bit of the serial mode control register sc0mod2 is set to ?1? in the sclk input mode, if no data is set to the transmit double buffer before the next data transfer clock after completing the transmission from the transmit shift register, this error flag is set to ?1? indicating an under-run error. if the transmit fifo is enabled, any data content in the transmit fifo will be mo ved to the buffer. wh en the transmit fifo and the double buffer are both empty, an under-run error will be generated. because no under-run errors can be generated in the sclk output mode, this flag is inoperative and the operation is undefined. if transmit buffer is disabled, the under-run flag will not be set. this flag is set to ?0? when it is read. note: to switch the i/o interface sclk output mo de to other modes, read the scxcr register and clear the under-run flag. 3. framing error : bit 2 of the sc0cr register in the uart mode, this bit is set to ?1? wh en a framing error is generated. this flag is set to ?0? when it is read. a framing erro r is generated if the corresponding stop bit is determined to be ?0? by sampling the bit at around the center. regardless of the (stop bit length) setting of the seri al mode control register 2, sc0mod2, the stop bit status is determined by only 1 bit on the receive side. operation mode error flag function oerr overrun error flag perr parity error flag uart ferr framing error flag oerr overrun error flag underrun error flag (wbuf = 1) perr fixed to 0 (wbuf = 0) i/o interface (sclk input) ferr fixed to 0 oerr operation undefined perr operation undefined i/o interface (sclk output) ferr fixed to 0
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 24 / 52 - 13.3.16 direction of data transfer in the i/o interface mode, the direction of data transfer can be switched between ?msb first? and ?lsb first? by the data transfer direction setting bit of the sc0mod2 serial mode control register 2. don't switch the direction when data is being transferred. 13.3.17 stop bit length in the uart transmission mode, the stop bit length can be set to either 1 or 2 bits by bit 4 of the sc0mod2 register. the length of the stop bit data is determined as one-bit when it is received regardless of the setting of this bit. 13.3.18 status flag if the double buffer function is enabled (sc0mod2 = ?1?), the bit 6 flag of the sc0mod2 register indicates the conditi on of receive buffer full. when one frame of data has been received and transferred from shift r egisters to buffers, this bit is set to ?1? to show that buffers are full (data is stored in t he buffers). when the receive buffer is read by cpu/dmac, it is cleared to ?0.? if is se t to ?0,? this bit is insignificant and must not be used as a status flag. when double buffering is enabled (sc0mod2 = ?1?), the bit 7 flag of the sc0mod2 register indi cates that transmit buffer is empty. when data is moved from transmit buffer to transmit sh ift register, this bit is set to ?1? indicating that transmit buffer is now empty. when data is set to the transmit buffer by cpu/dmac, the bit is cleared to ?0.? if is set to ?0,? this bit is insignificant and must not be used as a status flag.
tmpm380/m382 tmpm380/m382 - 25 / 52 - 13.3.19 configurations of transmit/receive buffer = 0 = 1 transmit buffer single double uart receive buffer double double transmit buffer single double i/o interface (sclk input) receive buffer double double transmit buffer single double i/o interface (sclk output) receive buffer single double 13.3.20 software reset software reset is generated by writing the bits 1 and 0 of sc0mod2 as ?10? followed by ?01?. as a resul t, sc0mod0, sc0mod1, sc0mod2,, of mo de registers and sc0cr, , of control registers and internal circui t is initialized. other states are maintained.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 26 / 52 - 13.3.21 signal generation timing c uart mode: receive side mode 9-bit 8-bit with parity 8-bit, 7-bit, and 7-bit with parity interrupt generation timing around the center of the 1st stop bit around the center of the 1st stop bit around the center of the 1st stop bit framing error generation timing around the center of the stop bit around the center of the stop bit around the center of the stop bit parity error generation timing ? around the center of the last (parity) bit around the center of the last (parity) bit overrun error generation timing around the center of the stop bit around the center of the stop bit around the center of the stop bit transmit side mode 9-bit 8-bit with parity 8-bit, 7-bit, and 7-bit with parity interrupt generation timing ( = 0) just before the stop bit is sent just before the stop bit is sent just before the stop bit is sent interrupt generation timing ( = 1) immediately after data is moved to transmit shift register (just before start bit transmission) immediately after data is moved to transmit shift register (just before start bit transmission). immediately after data is moved to transmit shift register (just bef ore start bit transmission)  i/o interface mode: receive side sclk output mode immediately after the rising edge of the last sclk interrupt generation timing ( = 0) sclk input mode immediately after the rising or falling edge of the last sclk (for rising or falling edge mode, respectively). sclk output mode immediately after the rising edge of the last sclk (just after data transfer to receive buffer) or just after receive buffer is read. interrupt generation timing ( = 1) sclk input mode immediately after the rising edge or falling edge of the last sclk (right after data is moved to receive buffer). overrun error generation timing sclk input mode immediately after the rising or falling edge of the last sclk (for rising or falling edge mode, respectively) transmit side sclk output mode immediately after the rising edge of the last sclk interrupt generation timing ( = 0) sclk input mode immediately after the rising or falling edge of the last sclk (for rising or falling edge mode, respectively) sclk output mode immediately after the rising edge of the last sclk or just after data is moved to transmit shift register interrupt generation timing ( = 1) sclk input mode immediately after the rising or falling edge of the last sclk or just after data is moved to transmit shift register under-run error generation timing sclk input mode immediately after the falling or rising edge of the next sclk (note 1) do not modify any control register when data is being sent or received (in a state ready to transmit or receive). (note 2) do not stop the receive operation (by setting sc0mod0 = ?0?) when data is being received. (note 3) do not stop the transmit operation (by setting sc0mod1 = ?0?) when data is being transmitted .
tmpm380/m382 tmpm380/m382 - 27 / 52 - 13.4 register description (only for channel 0) the channel 0 registers are described here. each regist er for all the channels operates in the same way. 13.4.1 enable register 7 6 5 4 3 2 1 0 bit symbol sioe read/write r r/w after reset 0 0 function ? ? is read. sio operation 0:disabled 1:enabled : specified the sio operation. to use the sio, enable the sio operation. when the operation is disabled, no clock is supp lied to the other registers in the sio module. this can reduce the power consumption. if the sio operation is executed and then disabl ed, the settings will be maintained in each register. 13.4.2 buffer register sc0buf works as a transmit buffer for wr operation and as a receive buffer for rd operation. 7 6 5 4 3 2 1 0 bit symbol tb7/rb7 tb6/rb6 tb5/rb5 tb4/rb4 tb3/rb3 tb2/rb2 tb1/rb1 tb0/rb0 read/write r/w after reset 0 0 0 0 0 0 0 0 function tb7~0 : transmit buffer/fifo rb7~0 : receive buffer/fifo transmit buffer (at wr operation). receive buffer (at rd operation). sc0en sc0buf
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 28 / 52 - 13.4.3 control register 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to ?0? when read) r/w after reset 0 0 0 0 0 0 0 0 0: normal operation 1: error function receive data bit 8 (for uart) parity (for uart) 0: odd 1: even add parity (for uart) 0: disabled 1: enabled overrun parity/ underrun framing 0: sclk0 1: sclk0 (for i/o interface) 0:baud rate generator 1:sclk0 pin input : 9 th bit of the received data in the 9 bits uart mode. : selects even or odd parity. ?0?: odd parity. ?1?: even parity. the parity bit may be used only in the 7- or 8-bit uart mode. : controls enabling/ disabling parity. the parity bit may be used only in the 7- or 8-bit uart mode. : : : error flag (see note) indicate overrun error, parity error, underrun error and framing error. : selects edge for data transmission and reception. ?0?: data transmit/receive at rising edges of sclk0 ?1?: data transmit/receive at falling edges of sclk0 : selects input clock in the i/o interface mode. ?0?: baud rate generator ?1?: sclk0 pin input. (note) any error flag is cleared when read. sc0cr
tmpm380/m382 tmpm380/m382 - 29 / 52 - 13.4.4 mode control register 0 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 handshake function control 0: cts diable 1: cts enable receive control 0:reception disabled 1:reception enabled wake-up function 0:reception disabled 1:reception enabled serial transfer mode 00: i/o interface mode 01: 7-bit length uart mode 10: 8-bit length uart mode 11: 9-bit length uart mode serial transfer clock (for uart) 00: tmrb,mpt output 01: baud rate generator 10: internal clock f sys 11: external clock (sclk0 input) : writes the 9 th bit of transmit data in the 9 bits uart mode. : controls handshake function. setting ?1? enables handshake function using cts pin. : controls reception (see note). set after setting each mode register (sc0mod0, sc0mod1 and sc0mod2). : controls wake-up function. this function is available only at 9-bit uart mode. 9-bit uart mode other modes 0 interrupt when received 1 interrupt only when rb9=1 don?t care : specifies transfer mode. : selects the serial transfer clock in the uart mode. as for the i/o interface mode, the serial trans fer clock can be set in the control register sc0cr . when tmrb,mpt output is used for the serial transfer clock, tb4out is used in sio0,1, tb7out is used in sio2,3, and mttb0out is used in sio4. (note 1) (note 2) with set to ?0,? set each mode register (sc0mod0, sc0mod1 and sc0mod2). then set to ?1.? do not stop the receive operation (by setting scxmod0 = "0") when data is being received. sc0mod0
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 30 / 52 - 13.4.5 mode control register 1 7 6 5 4 3 2 1 0 bit symbol i2sc fdpx1 fdpx0 txe sint2 sint1 sint0 - read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function idle 0: stop 1: start transfer mode setting 00: transfer prohibited 01: half duplex(rx) 10:half duplex(tx) 11:full duplex transmit control 0:disabled 1: enabled interval time of continuous transmission (for i/o interface) 000: none 100:8sclk 001:1sclk 101:16sclk 010:2sclk 110:32sclk 011:4sclk 111:64sclk write ?0?. : specifies the idle mode operation. : configures the transfer mode in the i/o in terface mode. also configures the fifo if it is enabled. in the uart mode, it is used only to specify the fifo configuration. : this bit enables transmission and is valid for all the transfer modes ( see note) . if disabled while transmission is in progress, transmission is inhibited only after the current frame of data is completed for transmission . : specifies the interval time of contin uous transmission when double buffering or fifo is enabled in the i/o interface mode. this para meter is valid only for the i/o interface mode when sclk0 pin input is not selected. (note 1) (note 2) specify the mode first and then specify the bit. do not stop the transmit operation (by setting = "0") when data is being transmitted. sc0mod1
tmpm380/m382 tmpm380/m382 - 31 / 52 - 13.4.6 mode control register 2 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r r/w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full in transmission flag 0: stop 1: start stop bit (for uart) 0: 1-bit 1: 2-bit setting transfer direction 0: lsb first 1: msb first w-buffer 0: disabled 1: enabled soft reset overwrite ?01? on ?10?to reset. : this flag shows that the transmit double buffers are empty. when data in the transmit double buffers is moved to the transmit shift register and the double buffers are empty, this bit is set to ?1.? writing data again to the double buffers sets this bit to ?0.? if double buffering is disabled, this flag is insignificant. : this is a flag to show that the receiv e double buffers are full. when a receive operation is completed and received data is moved from the receive shift register to the receive double buffers, this bit changes to ?1? while reading this bit changes it to ?0.? if double buffering is disabled, this flag is insignificant. : this is a status flag to show that data transmission is in progress. and bits indicate the following status. status 1 - transmission in progress 1 transmission completed 0 0 wait state with data in tx buffer : this specifies the l ength of stop bit transmission in the uart mode. on the receive side, the decision is made using only a si ngle bit regardless of the setting. : specifies the direction of data transfer in the i/o interface mode. in the uart mode, it is fixed to lsb first. : this parameter enables or disables th e transmit/receive buffers to transmit (in both sclk output/input modes) and receive (in sclk output mode) data in the i/o interface mode and to transmit data in the uart. when receiving data in the i/o interface mode (i sclk input) and uart mode, double buffering is enabled in both cases that 0 or 1 is set to bit. : overwriting ?01? in place of ?10? ge nerates a software reset. when this software reset is executed, the following bits, transmi tter, reciever and fifo are initialized (see note 1, 2 and 3) . register bit sc0mod0 rxe sc0mod1 txe sc0mod2 tbemp,rbfll,txrun, sc0cr oerr,perr,ferr sc0mod2
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 32 / 52 - (note 1) while data transmission is in progress, any software reset operation must be executed twice in succession. (note 2) a software reset requires 2 clocks-duration at the time between the end of recognition and the start of execution of software reset instruction. (note 3) a software reset initializes other bits. resetting a mode register and a control register are needed.
tmpm380/m382 tmpm380/m382 - 33 / 52 - 13.4.7 baud rate generator control register(sc0brcr) baud rate generator co ntrol register 2(sc0bradd) 7 6 5 4 3 2 1 0 bit symbol - br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function write ?0?. n + (16 ? k)/ 16 divider function 0: disabled 1: enabled select input clock to the baud rate generator 00: t1 01: t4 10: t16 11: t64 division ratio ?n? 0000: 16 0001: 1 0010: 2 : 1111: 15 7 6 5 4 3 2 1 0 bit symbol br0k3 br0k2 br0k1 br0k0 read/write r r/w after reset 0 0 0 0 0 function ?0? is read. specify k for the ?n + (16 ? k)/16? division 0000: prohibited 0001: k=1 0010: k=2 : 1111: k=15 : specifies n + (16-k)/16 division function. n + (16-k)/16 division function can only be used in the uart mode. : specifies the baud rate generator input clock. : specifies division ratio ?n?. : specifies k for the ?n+(16-k)/16? division. the division ratio of the baud rate generator c an be specified in the registers shown above. table 13-5 li st s the settings of baud rate generator division ratio. table 13-5 setting division ratio br0adde=0 br0adde=1 ( note 1) (only uart) br0s specify ?n? ( note 2) (note 3) br0k no setting required setting ?k? (note 4) division ratio divide by n n + 16 k)(16 ? division sc0brcr sc0bradd
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 34 / 52 - (note 1) to use the ?n + (16 - k)/16? division function, be sure to set br0k to ?1? after setting the k value to br0k. the ?n + (16 - k)/16? division function can only be used in the uart mode. (note 2) as a division ratio, 1 ("0001") or 16 ("0000") can not be applied to n when using the "n + (16 - k)/16"division function in the uart mode. (note 3) the division ratio "1" of the baud rate generator can be specified only when the double buffering is used in the i/o interface mode. (note 4) specifying ?k = 0? is prohibited.
tmpm380/m382 tmpm380/m382 - 35 / 52 - 13.4.8 fifo configuration register 7 6 5 4 3 2 1 0 bit symbol reserved reserved rese rved rfst tfie rfie rxtxcnt cnfg read/write r/w after reset 0 0 0 0 0 0 0 0 function be sure to write ?000?. bytes used in rx fifo 0: maximum 1:same as fill level of rx fifo tx interrupt for tx fifo 0: disabled 1: enabled rx interrupt for rx fifo 0:disabled 1: enabled automatic disable of rxe/txe 0:none 1:auto disabl e fifo enable 0: disabled 1: enabled : when rx fifo is enabled, the number of rx fifo bytes to be used is selected (see note 1) . 0: the maximum number of bytes of t he fifo configured (see also ). 1: same as the fill level for receive interr upt generation specified by sc0rfc . : when tx fifo is enabled, transmit interr upts are enabled or disabled by this parameter. : when rx fifo is enabled, receive interrupt s are enabled or disabled by this parameter. : controls automatic disabl ing of transmission and reception. the mode control register sc0mod1 is used to set the types of tx/rx. setting ?1? enables to operate as follows. half duplex rx when receive shift register, the receive buffer and the rx fifo are filled,sc0mod0 is automatically set to "0" to inhibit further reception. half duplex tx when the tx fifo, the transmit buffer and the transmit shift register is empty,sc0mod1 is automatica lly set to "0" to inhibit further transmission. full duplex when either of the above two conditions is satisfied, txe/rxe are automatically set to ?0? to inhibit further transmission and reception. : enables fifo. if enabled, the scomod1 setting automatically configures fifo as follows: (the type of tx/rx can be specified in the mode control register 1 sc0mod1). half duplex rx rx fifo 4byte half duplex tx tx fifo 4byte full duplex rx fifo 2byte tx fifo 2byte (note 1) regarding tx fifo, the maximum number of bytes being configured is always ? available. the available number of bytes is the bytes already written to the tx fifo. (note 2) the fifo can not use in 9bit uart mode. sc0fcnf
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 36 / 52 - 13.4.9 rx fifo configuration register 7 6 5 4 3 2 1 0 bit symbol rfcs rfis ril1 ril0 read/write w r/w r r/w after reset 0 0 0 0 0 function rx fifo clear 1: clear ?0? is read. select interrupt generation condition 0: when the data reaches to the specified fill level. 1: when the data reaches to the specified fill level or the data exceeds the specified fill level at the time data is read. ?0? is read. fifo fill level to generate r x interrupts 00:4byte 01:1byte 10:2byte 11:3byte : clears rx fifo setting ?1? clears rx fifo and ?0? is always read. : specifies the conditi on of interrupt generation. 0: an interrupt is generated when it re aches to the specified fill level. an interrupt is generated when it is reaches to the specified fill level or if it exceeds the specified fill level at the time data is read. : specifies fifo fill level. other than full duplex full duplex 00 4byte 2byte 01 1byte 1byte 10 2byte 2byte 11 3byte 1byte (note) to use tx/rx fifo buffer, tx/rx fifo must be cleared after setting the sio transfer mode (half duplex/full duplex) and enabling fifo (sc0fcnf = "1"). sc0rfc
tmpm380/m382 tmpm380/m382 - 37 / 52 - 13.4.10 tx fifo configuration register 7 6 5 4 3 2 1 0 bit symbol tfcs tfis til1 til0 read/write w r/w r r/w after reset 0 0 0 0 0 function tx fifo clear 1:clear always reads ?0?. select interrupt generation condition 0: when the data reaches to the specified fill level. 1: when the data reaches to the specified fill level or the data cannot reach the specified fill level at the time new data is read. ?0? is read. fifo fill level to generate t x interrupts. 00:empty 01:1byte 10:2byte 11:3byte : clears tx fifo. setting ?1? clears tx fifo and ?0? is always read. : selects interrupt generation condition. 0: an interrupt is generated when the data reaches to the specified fill level. 1: an interrupt is generated when the data reaches to the specified fill level or the data cannot reach the specified fill leve l at the time new data is read. : selects fifo fill level . other than full duplex full duplex 00 empty empty 01 1byte 1byte 10 2byte empty 11 3byte 1byte (note 1) to use tx/rx fifo buffer, tx/rx fifo must be cleared after setting the sio transfer mode (half duplex/full duplex) and enabling fifo (sc0fcnf = "1"). (note 2) set the sc0tfc register again after the following operation sc0en = "0" (sio operation stop) sc0mod1 = "0" (operation is prohibited in idle mode) and releasing the low power consumption mode which started by the wfi (wait for interrupt) instruction. sc0tfc
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 38 / 52 - 13.4.11 rx fifo status register 7 6 5 4 3 2 1 0 bit symbol ror rlvl2 rlvl1 rlvl0 read/write r r r after reset 0 0 0 0 0 function rx fifo overrun 1: generated ?0? is read. status of rx fifo fill level 000:empty 001:1byte 010:2byte 011:3byte 100:4byte : flags for rx fifo ov errun. when the overrun occurs, these bits are set to ?1? (see note). : shows the fill level of rx fifo. (note) the bit is cleared to ?0? when receive data is read from the sc0buf ? register. 13.4.12 tx fifo status register 7 6 5 4 3 2 0 bit symbol tur tlvl2 tlvl1 tlvl0 read/write r r r after reset 1 0 0 0 0 function tx fifo under run 1:generated cleared by writing fifo ?0? is read. status of tx fifo fill level 000:empty 001:1byte 010:2byte 011:3byte 100:4byte : flags for tx fifo und errun. when the underrun occurs, these bits are set to ?1? (see note). : shows the fill level of tx fifo. (note) the bit is cleared to ?0? when transmit data is written to the sc0buf register. sc0rst sc0tst
tmpm380/m382 tmpm380/m382 - 39 / 52 - 13.5 operation in each mode 13.5.1 mode 0 (i/o interface mode) mode 0 consists of two modes, the ?sclk output? mode to output synchronous clock and the ?sclk input? mode to accept synchronous clock from an exte rnal source. the following operational descriptions are for the case use of fifo is disabled. for details of fifo operation, refer to the previous sections describing receive/transmit fifo functions. c transmitting data sclk output mode in the sclk output mode, if sc0mod2 is set to ?0? and the transmit double buffers are disabled, 8 bits of data are out put from the txd0 pin and the synchronous clock is output from the sclk0 pin each time the cpu writes data to the transmit buffer. when all data is output, the inttx0 interrupt is generated. if sc0mod2 is set to ?1? and the transmit double buffers are enabled, data is moved from transmit buffer to transmit shift register when the cpu writes data to transmit buffer while data transmission is halted or when data transmission from transmit shift register (shift register) is completed. when data is moved from transmit buffer to transmit shift register, the transmit buffer empty flag sc0mod2 is set to ?1,? and the inttx0 interrupt is generated. if transmit buffer has no data to be moved to transmit shift register , the in ttx0 interrupt is not generated and the sclk0 output stops.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 40 / 52 - transmit data write timin g sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 =?0? (if double buffering is disabled) transimit data write timing sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 tbrun tbemp =?1? (if double buffering is enabled and there is data in buffer) transmit data write timing sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) tbrun tbemp =?1? (if double buffering is enabled and there is no data in buffer) fig 13-10 transmit operation in the i/o interface mode (sclk0 output mode) ?
tmpm380/m382 tmpm380/m382 - 41 / 52 - sclk input mode in the sclk input mode, if sc0mod2 is set to ?0? and the transmit double buffers are disabled, 8-bit data that has been written in the transmit buffer is output from the txd0 pin when the sclk0 input becomes active. when all 8 bits are sent, the inttx0 interrupt is generated. the next transmit data must be written before the timing point ?a? as shown in fig 13-11 . if sc0mod2 is set to ?1? and the transmit double buffers are enabled, data is moved from transmit buffer to transmit shift register when the cpu writes data to transmit buffer before the sclk0 becomes active or when data transmission from transmit shift register is completed. as data is moved from transmit buffer to transmit shift register, the transmit buffer empty flag sc0mod2 is set to ?1? and the inttx0 interrupt is generated. if the sclk0 i nput becomes active while no data is in transmit buffer, although the internal bit co unter is started, an under-run error occurs and 8-bit dummy data (ffh) is sent.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 42 / 52 - sclk0 input (=0 rising edge mode) sclk0 input (=1 falling edge mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 transimit data write timing bit 0 bit 1 a =?0? (if double buffering is disabled sclk0 input (=0 rising edge more) sclk0 input (=1 falling edge mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 transimit data write timing bit 0 bit 1 a tbrun tbemp =?1? (if double buffering is enabled and there is data in buffer) sclk0 input (=0 rising edge mode) sclk0 input (=1 falling edge mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 transmit data write timing 1 a tbrun tbemp perr( functions to detect unde r-run errors ) =?1? (if double buffering is enabled and there is no data in buffer) fig 13-11 transmit operation in the i/o interface mode (sclk0 input mode)
tmpm380/m382 tmpm380/m382 - 43 / 52 - d receiving data sclk output mode in the sclk output mode, if sc0mod2 = ?0? and receive double buffering is disabled, a synchronous clock pulse is out put from the sclk0 pin and the next data is shifted into receive shift register each time the cpu reads received data. when all the 8 bits are received, the intrx0 interrupt is generated. the first sclk output can be started by setting the receive enable bit sc0mod0 to ?1.? if the receive double buffering is enabled with sc0mod2 set to ?1,? the first frame received is moved to receive buffer and receive shift register can receive the next frame successively. as data is moved from receive shift register to receive buffer, the receive buffer full flag sc0mod2 is set to ?1? and the intrx0 interrupt is generated. while data is in receive buffer, if cpu/dmac cannot read data from receive buffer before completing reception of the next 8 bi ts, the intrx0 interrupt is not generated and the sclk0 clock stops. in this state, reading data from receive buffer allows data in receive shift register to move to rece ive buffer and thus the intrx0 interrupt is generated and data reception resumes. receive data write timing sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit 0 =?0? (if double buffering is disabled) receive data write timing sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit 0 bit 7 rbfull =?1? (if double buffering is enabled and data is read from buffer) receive data write timing sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit 7 rbfull =?1? (if double buffering is enabled and data cannot be read from buffer) fig 13-12 receive operation in the i/o interface mode (sclk0 output mode)
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 44 / 52 - sclk input mode in the sclk input mode, receiving double buf fering is always enabled, the received frame can be moved to receive buffer and receive sh ift register can receive the next frame successively. the intrx0 receive interrupt is generated each time received data is moved to received buffer. sclk0 input (=0 rising edge mode) sclk0 input (=1 falling edge mode) bit 0 bit 1 rxd0 i ntrx0 interrupt request) bit 5 bit 6 bit 7 receive data read timing bit 0 rbfull sclk0 input (=0 rising edge mode) sclk0 input (=1 falling edge mode) bit 0 bit 1 rxd0 i ntrx0 interrupt request) bit 5 bit 6 bit 7 receive data read timing bit 0 rbfull oerr if data cannot be read from buffer fig 13-13 receive operation in the i/o interface mode (sclk0 input mode) (note) to receive data, sc0mod must always be set to ?1? (receive enable) in the sclk output / sclk input mode. if data is read from buffer
tmpm380/m382 tmpm380/m382 - 45 / 52 - e transmit and receive (full-duplex) the full-duplex mode is enabled by setting bit 6 of the serial mode control register 1 (sc0mod1) to ?1?. sclk output mode in the sclk output mode, if sc0mod2 is set to ?0? and both the transmit and receive double buffers are disabled, sclk is output when the cpu writes data to the transmit buffer. subsequently, 8 bits of dat a are shifted into receive shift register and the intrx0 receive interrupt is generated . concurrently, 8 bits of data written to the transmit buffer are output from the tx d0 pin, the inttx0 transmit interrupt is generated when transmission of all data bits has been completed. then, the sclk output stops. in this, the next round of data transmission and reception starts when the data is read from the receive buffer and the nex t transmit data is written to the transmit buffer by the cpu. the order of reading t he receive buffer and writing to the transmit buffer can be freely determined. data transmission is resumed only when both conditions are satisfied. if sc0mod2 = ?1? and double buffering is enabled for both transmission and reception, sclk is output when the cpu writes data to the transmit buffer. subsequently, 8 bits of data are shifted into receive shift register, moved to receive buffer, and the intrx0 interrupt is generated. while 8 bits of data is received, 8 bits of transmit data is output from the txd0 pin. when all data bits are sent out, the inttx0 interrupt is generated and the next data is mo ved from the transmit buffer to transmit shift register. if transmit buffer has no dat a to be moved to transmit shift register (sc0mod2 = 1) or when receive buffer is full (sc0mod2 = 1), the sclk clock is stopped. when both cond itions, receive data is read and transmit data is written, are satisfied, the sclk output is resumed and the next round of data transmission is started.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 46 / 52 - receive data read timing sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 transmit data write timing (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 =?0? (if double buffering is disabled) receive data read timing sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 transmit data write timing (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 =?1? (if double buffering is enabled) receive data read timing sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) transmit data write timing (intrx0 interrupt request) bit 5 bit 0 bit 6 bit 7 bit 1 rxd0 bit 5 =?1? (if double buffering is enabled) fig 13-14 transmit/receive operation in t he i/o interface mode (sclk0 output mode)
tmpm380/m382 tmpm380/m382 - 47 / 52 - sclk input mode in the sclk input mode with sc0mod2 set to ?0? and the transmit double buffers are disabled (double buffering is al ways enabled for the receive side), 8-bit data written in the transmit buffer is output from the txd0 pin and 8 bits of data is shifted into the receive buffer when the sclk input becomes active. the inttx0 interrupt is generated upon completion of data transmission and the intrx0 interrupt is generated at the instant the received data is moved from receive shift register to receive buffer. note that transmit data must be written into the transmit buffer before the sclk input for the next frame (data must be written before the point a in fig 13-15 ). as doubl e buffering is enabled for data reception, data must be read before completing reception of the next frame data. if sc0mod2 = ?1? and double buffering is enabled for both transmission and reception, the interrupt intrx0 is generated at the timing transmit buffer data is moved to transmit shift register after completing data transmission from transmit shift register. at the same time, the 8 bits of data received is shifted to shift register, it is moved to receive buffer, and the intrx0 in terrupt is generated. upon the sclk input for the next frame, transmission from transmi t shift register (in which data has been moved from transmit buffer) is started while receive data is shifted into receive shift register simultaneously. if data in receive buffer has not been read when the last bit of the frame is received, an overrun error occurs . similarly, if there is no data written to transmit buffer when sclk for the next frame is input, an under-run error occurs.
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 48 / 52 - receive data read timing sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 transmit data write timing (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 =?0? (if double buffering is disabled) receive data read timing sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 transmit data write timing (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 =?1? (if double buffering is enabled with no errors) receive data read timing sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 transmit data write timing (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 perr under-run errors =?1? (if double buffering is enabled with error generation) fig 13-15 transmit/receive operation in the i/o interface mode (sclk0 input mode) a
tmpm380/m382 tmpm380/m382 - 49 / 52 - 13.5.2 mode 1 (7-bit uart mode) the 7-bit uart mode can be selected by setti ng the serial mode control register (sc0mod ) to ?01?. in this mode, parity bits can be added to the transmit data stream; the serial mode control register (sc0cr ) controls the parity enabl e/disable setting. when is set to ?1? (enable), either even or o dd parity may be selected using the sc0cr bit. the length of the stop bit can be specified using sc0mod2. the following table shows the control register settings for transmitting in the following data format. transmission direction (transmission rate of 2400 bps @ fc = 9.8304 mhz) start bit 0 1 2 3 5 4 6 even parity stop * clocking conditions system clock : high- speed (fc) high-speed clock gear : x1 (fc) prescaler clock : f periph/2 (f periph = fsys )
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 50 / 52 - 13.5.3 mode 2 (8-bit uart mode) the 8-bit uart mode can be selected by setting sc0mod0 to ?10.? in this mode, parity bits can be added and parity enable/disable is controlled using sc0cr . if = ?1? (enabled), either even or odd parity can be se lected using sc0cr . the control register settings for receiving data in the following format are as follows: transmission direction (transmission rate of 9600 bps @ fc = 9.8304 mhz) start bit 0 1 2 3 5 4 6 odd parity stop 7 * clocking conditions system clock : high-speed (fc) high-speed clock gear : x1 (fc) prescaler clock : f periph/4 (f periph = fsys )
tmpm380/m382 tmpm380/m382 - 51 / 52 - 13.5.4 mode 3 (9-bit uart) the 9-bit uart mode can be selected by setti ng sc0mod0 to ?11.? in this mode, parity bits must be disabled (sc0cr = ?0?). the most significant bit (9th bit) is written to bit 7 of the serial mode control register 0 (sc0mod0) for transmitting data. the data is st ored in bit 7 of the serial control register sc0cr. when writing or reading data to/from the buffers, the most significant bit must be written or read first before writing or reading to/from sc0buf. the stop bit length can be specified using sc0mod2 . wakeup function in the 9-bit uart mode, slave controllers can be operated in the wake-up mode by setting the wake-up function control bit sc0mod0 to ?1.? in this case , the interrupt intrx0 will be generated only when sc0c r is set to ?1?. (note) the txd pin of the slave controller must be set to the open drain output mode using the ode register. fig 13-16 serial links to use wake-up function txd master slave 1 slave 2 slave 3 rxd txd rxd txd txd rxd rxd
13 serial channel (uart/sio) tmpm380/m382 tmpm380/m382 - 52 / 52 - protocol c select the 9-bit uart mode for the master and slave controllers. d set sc0mod to ?1? for the slave contro llers to make them ready to receive data. e the master controller is to transmit a single frame of data that includes the slave controller select code (8 bits). in this, the most signif icant bit (bit 8) must be set to ?1?. slave controller select code start bit 0 1 2 3 5 4 6 stop 7 8 ?1? f each slave controller receives the above dat a frame; if the code received matches with the controller's own select code, it clears the wu bit to ?0?. g the master controller transmits data to t he designated slave controller (the controller of which sc0mod bit is cleared to ?0?). in this, the most significant bit (bit 8) must be set to ?0?. data ?0? start bit 0 1 2 3 5 4 6 stop 7 bit 8 h the slave controllers with the bit set to ?1? ignore the receive data because the most significant bit (bit 8) is set to ?0? a nd thus no interrupt (intrx0) is generated. also, the slave controller with the bi t set to ?0? can transmit data to the master controller to inform that the data has been successfully received. an example: using the internal clock f sys as the transfer clock, two slave controllers are serially linked as follows. txd master slave 1 slave 2 select code 00000001 rxd txd rxd txd rxd select code 00001010
tmpm380/m382 tmpm380/m382 - 1 / 28 - 14. ssp (synchronous serial port) this lsi contains an ssp (synchrono us serial port) with two channels. each channel has the following features: channels 0 to 1 communication protocol three types of sync hronous serial ports including the spi operation mode master/slave mode transmit fifo 16 bits wide / 8 tiers deep receive fifo 16 bits wide / 8 tiers deep transmitted/ received data size 4 to 16 bits interrupt type transmit interrupt receive interrupt receive overrun interrupt timeout interrupt in master mode: fsys / 2 (max. 10mbps: when system clock is 40mhz, divide by 4) communication speed in slave mode: fsys (40mhz) / 12 (max. 3.3mbps) (when slave mode is selected, sspxcr0=0x00, sspxcpsr=0x2) dma supported internal test function can use t he internal loopback test mode. channel 0 channel 1 control pin sp0clk sp0fss sp0do sp0di sp1clk sp1fss sp1do sp1di important tmpm382 (64-pin version) does not implement ssp1. please do not use these functions if you use this product.
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 2 / 28 - 14.1 block diagram fifo status and interrupt generation 16bit 8 transmit fifo 16bit 8 receive fifo transmission/ reception logic bus interface and register read data [15:0] write data [15:0] rxd [15:0] txd [15:0] sp0clk sp0do sp0 transmission (dma request: burst) interrupt request clock prescaler sp0di sp0fss sspclkdiv tx/rx param overrun timeout reception buffer processing request transmission buffer processing request ssp channel 0 intssp0 dma interface dma transfer request sp0 reception (dma request: burst) sp0 reception (dma request: single) sp0 transmission (dma clear) sp0 reception (dma clear) sp1clk sp1do sp1 transmission (dma request: burst) interrupt request sp1di sp1fss ssp channel 1 intssp1 sp1 reception (dma request: burst) sp1 reception (dma request: single) sp1 transmission (dma clear) sp1 reception (dma clear) fsys fsys
tmpm380/m382 tmpm380/m382 - 3 / 28 - 14.2 overview of ssp this lsi contains the ssp with two channels: c hannels 0, and 1 channels operate in the same way, only channel 0 is described in the following sections. the ssp is an interface that enables serial communi cations with the periphe ral devices with three types of synchronous serial interface functions. the ssp performs serial-parallel co nversion of the data received from a peripheral device. the transmit path buffers data in the independent 16-bit wide and 8-layered transmit fifo in the transmit mode, and the receive path buffers data in the 16-bit wide and 8-layered receive fifo in receive mode. serial data is transmitted via sp0do and received via sp0di. the ssp contains a programmable prescaler to gener ate the serial output clock sp0clk from the input clock fsys. the operation mode, frame format, and data size of the ssp are programmed in the control registers ssp0cr0 and ssp0cr1. (1) clock prescaler when configured as a master, a clock prescale r comprising two free-running serially linked counters is used to provide the serial output clock sp0clk. you can program the clock prescale r through the ssp0cpsr register, to divide fsys by a factor of 2 to 254 in steps of two. because the least signifi cant bit of the ssp0cpsr register is not used, division by an odd number is not possible. the output of the prescaler is further divided by a factor of 1 to 256, which is obtained by adding 1 to the value programmed in the ssp0cr0 control register, to give the master output clock sp0clk. bit rate = fsys / (cpsdvsr (1+scr)) (2) transmit fifo this is a 16-bit wide, 8-layered transmit fifo buffer, which is shared in master and slave modes. (3) receive fifo this is a 16-bit wide 8-layered receive fifo buffe r, which is shared in master and slave modes. sspclkdiv toggle circuit clock initial value ? (depends on the setting) clock invert trigger sp0clk fsys (scr [7:0] + 1) divider circuit ? cpsdvsr [7:1] clock prescaler
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 4 / 28 - (4) interrupt generation logic four high active interrupts, each of which c an be masked separately, are generated. also, individual interrupt requests are combined and output as a single integrated interrupt. ? transmit interrupt: interrupt conditional upon txfifo having free space equal to or more than half its entire capacity. (number of valid data items in the txfifo 4) ? receive interrupt: interrupt conditional upon rx fifo having valid data equal to or more than half its entire capacity. (number of valid data items in the rxfifo 4) ? timeout interrupt: interrupts indicating that t he data in rxfifo is not read before the timeout period expires. ? receive overrun interrupt: conditional interrupts indicating that data is written to rxfifo when it is full when any of the above interrupts is asserted, intssp0 is asserted. (a) transmit interrupt the transmit interrupt is assert ed when there are four or fewer valid entries in the transmit fifo. the transmit interrupt is also generated when the ssp operation is disabled (ssp0cr1=0). the first transmitted data can be written in the fifo by using this interrupt. (b) receive interrupt the receive interrupt is assert ed when there are four or more valid entries in the receive fifo. (c) timeout interrupt the receive timeout interrupt is asserted when the receive fifo is not empty and the ssp has remained idle for a fixed 32-bit period (bit ra te). this mechanism ensures that the user is aware that data is still present in the receiv e fifo and requires servicing. this operation occurs in both master and slave modes. when the timeout interrupt is generated, read all data from the receive fifo. even if all the dat a is not read, data can be transmitted/received if the receive fifo has a free space and the number of data to be transmitted does not exceed the free space of the receive fifo. when transfer starts, the timeout interrupt will be cleared. if data is transmitted/received when the receive fifo has no free space, the timeout interrupt will not be cleared and an ov errun interrupt will be generated. sp0clk receive fifo empty flag (rne) bit rate x 32 receive timeout interrupt (rtintr) receive timeout interrupt enable (rtim) during data transfe r internal down counter enable
tmpm380/m382 tmpm380/m382 - 5 / 28 - (d) receive overrun interrupt when the next data (9th data item) is receiv ed when the receive fifo is already full, a receive overrun interrupt is generated immediat ely after transfer. the data received after the receive overrun interrupt is generated (inclu ding the 9th data item) will become invalid and be discarded. however, if data is read from t he receive fifo while the 9th data item is being received (before the in terrupt is generated), the 9th re ceived data will be written in the receive fifo as valid data. to perform trans fer properly when the receive overrun interrupt has been generated, write "1" to the receive ov errun interrupt clear register, and then read all data from the receive fifo. even if all the dat a is not read, data can be transmitted/received if the receive fifo has free space and the number of data to be transmitted does not exceed the free space of the receive fifo. note that if the receive fifo is not read (provided that the receive fifo is not empty) within a certain 32 -bit period (bit rate) after the receive overrun interrupt is cleared, a timeout interrupt will be generated. (e) combined interrupt the above four interrupts combine individual masked sources into a single interrupt. when any of the above interrupts is asserted, the integrated inte rrupt intssp0 is asserted. (5) dma interface the ssp provides an interface to connect to a dma controller. intssp0 txim (mask) pre-enable transmit interrupt post-enable receive interrupt rxim (mask) pre-enable receive interrupt post-enable timeout interrupt post-enable receive overrun interrupt rtim (mask) pre-enable timeout interrupt rorim (mask) pre-enable receive overrun interrupt post-enable transmit interrupt
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 6 / 28 - 14.3 ssp operation (1) initial settings for ssp settings for the ssp communication protocol must be made with the ssp disabled. control registers ssp0cr0 and ssp0cr1 need to conf igure this ssp as a master or slave operating under one of the following protocols. in addition, make the settings related to the communication speed in the prescale registers ssp0cpsr and ssp0cr0. this ssp supports the following protocols: ? spi, ssi, microwire (2) ssp enable the transfer operation starts when the operation is enabled with the transmitted data written in the transmit fifo, or when transmitted data is written in the transmit fifo with the operation enabled. however, if the transmit fifo co ntains only four or fewer entries when the operation is enabled, a transmit interrupt will be gener ated. this interrupt can be us ed to write the initial data. note) when the ssp is in the spi slave mode and the fss pin is not used, be sure to transmit data of one byte or more in the fifo before enabling the operation. if the operation is enabled with the transmit fifo empty, the transfer data will not be output correctly. (3) clock ratios when setting a frequency for pclk, the following conditions must be met. [in master mode] f sp0clk (maximum) => fsys / 2 (note) f sp0clk (minimum) => fsys / (254 x 256) [in slave mode] f sp0clk (maximum) => fsys / 12 f sp0clk (minimum) => fsys / (254 x 256) note) fsys is output from clock gear. in det ails, please refer the chapter of clock gear. in tmpm380, maximum baud-rate is 10mbps. when system clock is 40mhz, divide by 4) (4) frame format each frame format is between 4 and 16 bits wide depending on the size of data programmed, and is transmitted starting from the msb. ? serial clock (sp0clk) signals remain low in the ssi and microwire format s and as inactive in the spi format while the ssp is in the idle state. in addition, data is output at the set bit rate onl y during data transmission. ? serial frame (sp0fss) in the spi and microwire frame formats, signals are set to low active and always asserted to low during frame transmission. in the ssi frame format, signals are asserted only during 1 bit rate before each frame transmission. in this frame format, output data is transmitted at the rising edge of sp0clk and the input data is received at its falling edge.
tmpm380/m382 tmpm380/m382 - 7 / 28 - ? notes on the microwire the microwire format uses a special master/slave messaging method, which operates in half-duplex mode. in this mode, when a frame be gins, an 8-bit control message is transmitted to the slave. during this transmit, no incoming dat a is received by the ssp. after the message has been transmitted, the slave decodes it, and after waiting one serial clock after the last bit of the 8-bit control message has been sent, it responds with the requested data. the returned data can be 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits. the details of each frame format are described below: (a) ssi frame format in this mode, the ssp is in idle state, sp0cl k and sp0fss are forcedly set to low, and the transmit data line sp0do becomes hi-z. when data is written in the transmit fifo, the master outputs high pulses of 1 sp0clk to t he sp0fss line. the transmitted data will be transferred from the transm it fifo to the transmit serial shi ft register. data of 4 to 16 bits will be output from the sp0do pin at the next rising edge of sp0clk. likewise, the received data will be input starting from the msb to the sp0di pin at the falling edge of sp0clk. the received data will be transferr ed from the serial shift register into the receive fifo at the rising edge of sp0clk after its lsb data is latched. ssi frame format (transmission/ reception during single transfer) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitable pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. sp0clk sp0fss sp0di msb lsb 4 to 16bit sp0do msb lsb hi-z(note1) hi-z(note1) hi-z(note2) hi-z(note2)
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 8 / 28 - ssi frame format (transmission/re ception during continuous transfer) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. sp0clk sp0fss sp0do/sp0di msb lsb 4 to 16 bits msb
tmpm380/m382 tmpm380/m382 - 9 / 28 - (b) spi the spi interface has 4 lines. sp0fss is used for slave selection. one of the main features of the spi format is that the and bits in the ssp0cr0 control register can be used to set the sp0clk operation timing. ssp0cr0 ssp0cr0 is used to set the level at which sp0clk in idle state is held. =1: sets sp0clk in high state =0: sets sp0clk in low state ssp0cr0 ssp0cr0 is used to select the cl ock edge at which data is latched. ssp0cr0=0: captures dat a at the 1st clock edge. ssp0cr0=1: captures data at the 2nd clock edge. spi frame format (single tr ansfer, =0 & =0) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. sp0clk sp0fss sp0di msb lsb msb lsb sp0do hi-z(note1) hi-z ( note1 ) hi-z ( note2 ) hi-z ( note2 )
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 10 / 28 - spi frame format (continuous transfer, = 0 & =0) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. with this setting, during the idle period: ? the sp0clk signal is forcedly set to low. ? sp0fss is forcedly set to high. ? the transmit data line sp0do is set to low. if the ssp is enabled and valid data exists in the transmit fifo, the sp0fss master signal driven by low notifies of the st art of transmission. this enables the slave data in the sp0di input line of the master. when a half of the sp0clk period has passed, valid master data is transferred to the sp0do pin. both the master data and slave dat a are now set. when another half of sp0clk has passed, the sp0clk master clock pin become s high. after that, the data is captured at the rising edge of the sp0clk signal and transmitted at its falling edge. in the single word transfer, the sp0fss line will return to the idle hi gh state when all the bi ts of that data word have been transferred, and then one cycle of sp0clk has passed after the last bit was captured. however, for continuous transfer, the sp0fss signal must be pulsed at high between individual data word transfers. this is because change is not enabled when the slave selection pin freezes data in its peripheral register and the bit is logical 0. therefore, to enable writing of serial peripheral data, the master device must drive the sp0fss pin of the slave device between indivi dual data transfers. when the continuous transfer is complete, the sp0fss pin will return to the idle state when one cycle of sp0clk has passed after the last bit is captured. sp0clk sp0fss sp0di msb lsb 4 to 16bit lsb msb hi-z(note2) hi-z(note2) sp0do msb lsb lsb msb
tmpm380/m382 tmpm380/m382 - 11 / 28 - (c) microwire frame format microwire frame format (single transfer) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. though the microwire format is similar to the spi format, it uses the master/slave message transmission method for half-duplex communication s. each serial transmission is started by an 8-bit control word, which is sent to the off- chip slave device. during this transmission, the ssp does not receive input data. after the messag e has been transmitted, the off-chip slave decodes it, and after waiting one serial clock after the last bit of the 8-bit control message has been sent, responds with the requested data. the returned data can be 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits. with this configuration, during the idle period: ? the sp0clk signal is forcedly set to low. ? sp0fss is forcedly set to high. ? the transmit data line sp0do is set to low. a transmission is triggered by writing a contro l byte to the transmit fifo. the falling edge of sp0fss causes the value stored in the bottom ent ry of the transmit fifo to be transferred to the serial shift register for the transmit logi c, and the msb of the 8-bit control frame to be shifted out onto the sp0do pin. sp0fss remains low and the sp0d1 pin remains tristated during this transmission. the off-chip serial slave device latches each control bit into its serial shifter on the rising edge of each sp0clk. after t he last bit is latched by the slave device, the control byte is decoded during a one clock wait -state, and the slave responds by transmitting data back to the ssp. each bit is driven ont o sp0di line on the falling edge of sp0clk. the ssp in turn latches each bit on the rising edge of sp0clk. at the end of the frame, for single transfers, the sp0fss signal is pulled high one clock period after the last bit has been latched in the receive serial shifter, which causes the data to be transferred to the receive sp0clk sp0fss sp0do lsb 8bit hi-z ( note1 ) sp0di msb hi-z(note1) hi-z ( note2 ) lsb msb hi-z ( note2 ) 4 to 16bit
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 12 / 28 - fifo. note) the off-chip slave device can tristate the receive line either on the falling edge of sp0clk after the lsb has been latched by the receive shifter, or when the sp0fss pin goes high.
tmpm380/m382 tmpm380/m382 - 13 / 28 - microwire frame format (continuous transfer) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. for continuous transfers, data transmission begi ns and ends in the same manner as a single transfer. however, the sp0fss line is continuo usly asserted (held low) and transmission of data occurs back to back. the control byte of the next frame follows directly after the lsb of the received data from the cu rrent frame. each of the receiv ed values is transferred from the receive shifter on the falling edge of sp0cl k, after the lsb of the frame has been latched into the ssp. note) [example of connection] the ssp does not support dynamic switching between the master and slave in the system. each sample ssp is configured and connected as ei ther a master or slave. sp0clk sp0fss sp0do lsb 8bit sp0di msb hi-z ( note1 ) hi-z ( note2 ) lsb msb hi-z(note2) 4 to 16bit hi-z ( note1 ) lsb msb
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 14 / 28 - (5) dma interface the dma operation of the ssp is controlled through the dma control register, sp0dmacr. when there are more data than the watermark leve l (half of the fifo) in the receive fifo, the receive dma request is asserted. when the amount of data left in the receive fifo is less than the watermark level (half of the fifo), the transmit dm a request is asserted. to clear the transmit/receive dma request, an input pin for the transmit/receive dma request clear signals, which are asserted by the dma controller, is provided. set the dma burst length to four words. * for the remaining three c haracters, the ssp does not a ssert the burst request. each request signal remains asserted until the re levant dma clear signal is asserted. after the request clear signal is deasserted, a request signal can become active again, depending on the conditions described above. all request signals are deas serted if the ssp is disabled or the dma enable signal is cleared. the following table shows the trigger points for dmabreq, for both the transmit and receive fifos. burst length watermark level transmit (number of empty locations) receive (number of filled locations) 1/2 4 4
tmpm380/m382 tmpm380/m382 - 15 / 28 - 14.4 explanation of the register the following lists the sfrs: ? ssp0 register name address (base+) description ssp0cr0 0x0000 control register 0 ssp0cr1 0x0004 control register 1 ssp0dr 0x0008 receive fifo (read) and trans mit fifo data register (write) ssp0sr 0x000c status register ssp0cpsr 0x0010 clock pr escale register ssp0imsc 0x0014 interrupt enable/disable register ssp0ris 0x0018 pre-enable interr upt status register ssp0mis 0x001c post-enable inte rrupt status register ssp0icr 0x0020 interrupt clear register ssp0dmacr 0x0024 dma control register ? 0x0028 0xffc reserved ? ssp1 register name address (base+) description ssp1cr0 0x0000 control register 0 ssp1cr1 0x0004 control register 1 ssp1dr 0x0008 receive fifo (read) and trans mit fifo data register (write) ssp1sr 0x000c status register ssp1cpsr 0x0010 clock pr escale register ssp1imsc 0x0014 interrupt enable/disable register ssp1ris 0x0018 pre-enable interr upt status register ssp1mis 0x001c post-enable inte rrupt status register ssp1icr 0x0020 interrupt clear register ssp1dmacr 0x0024 dma control register ? 0x0028 0xffc reserved base address = 0x400c_0000 base address = 0x400c_1000
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 16 / 28 - 14.4.1 ssp0cr0 (ssp0 control register 0) bit bit symbol type reset value description [31:16] ? ? undefined read undefined. write as zero. [15:8] scr r/w 0y0 for serial clock rate setting parameter: [refer to explanation]) 0x00 0xff [7] sph r/w 0y0 spclk phase (applicable to motorola spi frame format only, refer to [motorola spi frame format]) [6] spo r/w 0y0 spclk polarity (applicable to motorola spi frame format only, refer to [motorola spi frame format]) [5:4] frf r/w 0y00 frame format: 0y00: motorola spi frame format 0y01: ti synchronous serial frame format 0y10: national microwire frame format 0y11: reserved, undefined operation [3:0] dss r/w 0y0000 data size select: 0y0000: reserved, undefined operation 0y0001: reserved, undefined operation 0y0010: reserved, undefined operation 0y0011: 4-bit data 0y0100: 5-bit data 0y0101: 6-bit data 0y0110: 7-bit data 0y0111: 8-bit data 0y1000: 9-bit data 0y1001: 10-bit data 0y1010: 11-bit data 0y1011: 12-bit data 0y1100: 13-bit data 0y1101: 14-bit data 0y1110: 15-bit data 0y1111: 16-bit data a ddress = (0x400c_0000) + 0x0000
tmpm380/m382 tmpm380/m382 - 17 / 28 - 14.4.2 ssp1cr0 (ssp1 control register 0) bit bit symbol type reset value description [31:16] ? ? undefined read undefined. write as zero. [15:8] scr r/w 0y0 for serial clock rate setting parameter: 0x00 0xff [7] sph r/w 0y0 spclk phase (applicable to motorola spi frame format only, refer to [motorola spi frame format]) [6] spo r/w 0y0 spclk polarity (applicable to motorola spi frame format only, refer to [motorola spi frame format]) [5:4] frf r/w 0y00 frame format: 0y00: motorola spi frame format 0y01: ti synchronous serial frame format 0y10: national microwire frame format 0y11: reserved, undefined operation [3:0] dss r/w 0y0000 data size select: 0y0000: reserved, undefined operation 0y0001: reserved, undefined operation 0y0010: reserved, undefined operation 0y0011: 4-bit data 0y0100: 5-bit data 0y0101: 6-bit data 0y0110: 7-bit data 0y0111: 8-bit data 0y1000: 9-bit data 0y1001: 10-bit data 0y1010: 11-bit data 0y1011: 12-bit data 0y1100: 13-bit data 0y1101: 14-bit data 0y1110: 15-bit data 0y1111: 16-bit data a ddress = (0x400c_1000) + 0x0000
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 18 / 28 - [explanation] a. used to generate the spp transmit bit rate and receive bit rate. this bit rate can be obtained by the following equation: bit rate = fsys / (cpsdvsr (1+scr)) cpsdvsr is an even number between 2 to 254, which is programmed by the sspxcpsr register, and scr takes a value between 0 to 255.
tmpm380/m382 tmpm380/m382 - 19 / 28 - 14.4.3 ssp0cr1 (ssp0 control register 1) 14.4.4 ssp1cr1 (ssp1 control register 1) [explanation] a. slave mode output disable. this bit is relevant only in the slave mode (=1). bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] sod r/w 0y0 slave mode sp0do output control: 0y0: enable 0y1: disable [2] ms r/w 0y0 master/slave mode select: 0y0: device configured as a master 0y1: device configured as a slave [1] sse r/w 0y0 ssp0 enable: 0y0: disable 0y1: enable [0] lbm r/w 0y0 loop back mode: 0y0: normal serial port operation enabled 0y1: output of transmit serial shifter is connected to input of receive serial shifter internally. bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] sod r/w 0y0 slave mode sp0do output control: 0y0: enable 0y1: disable [2] ms r/w 0y0 master/slave mode select: 0y0: device configured as a master 0y1: device configured as a slave [1] sse r/w 0y0 ssp1 enable: 0y0: disable 0y1: enable [0] lbm r/w 0y0 loop back mode: 0y0: normal serial port operation enabled 0y1: output of transmit serial shifter is connected to input of receive serial shifter internally. a ddress = (0x400c_0000) + 0x0004 a ddress = (0x400c_1000) + 0x0004
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 20 / 28 - 14.4.5 ssp0dr (ssp0 data register) 14.4.6 ssp1dr (ssp1 data register) [explanation] a. read: receive fifo write: transmit fifo you must right-justify data when the ssp is programmed for a data size that is less than 16 bits. unused bits at the top are ignored by trans mit logic. the receive logic automatically right-justifies. bit bit symbol type reset value description [31:16] ? ? undefined read undefined. write as zero. [15:0] data r/w 0x0000 transmit/receive fifo data: 0x00 ~ 0xff bit bit symbol type reset value description [31:16] ? ? undefined read undefined. write as zero. [15:0] data r/w 0x0000 transmit/receive fifo data: 0x00 ~ 0xff a ddress = (0x400c_0000) + 0x0008 a ddress = (0x400c_1000) + 0x0008
tmpm380/m382 tmpm380/m382 - 21 / 28 - 14.4.7 ssp0sr (ssp0 status register) 14.4.8 ssp1sr (ssp1 status register) [explanation] a. bsy="1" indicates that the ssp is currently trans mitting and/or receiving a frame or the transmit fifo is not empty. bit bit symbol type reset value description [31:5] ? ? undefined read undefined. write as zero. [4] bsy r 0y0 busy flag 0y0: idle 0y1: busy [3] rff r 0y0 receive fifo full: 0y0: receive fifo is not full 0y1: receive fifo is full [2] rne r 0y0 receive fifo empty flag 0y0: receive fifo is empty 0y1: receive fifo is not empty [1] tnf r 0y1 transmit fifo full flag: 0y0: transmit fifo is full 0y1: transmit fifo is not full [0] tfe r 0y1 transmit fifo empty flag: 0y0: transmit fifo is not empty 0y1: transmit fifo is empty bit bit symbol type reset value description [31:5] ? ? undefined read undefined. write as zero. [4] bsy r 0y0 busy flag 0y0: idle 0y1: busy [3] rff r 0y0 receive fifo full: 0y0: receive fifo is not full 0y1: receive fifo is full [2] rne r 0y0 receive fifo empty flag 0y0: receive fifo is empty 0y1: receive fifo is not empty [1] tnf r 0y1 transmit fifo full flag: 0y0: transmit fifo is full 0y1: transmit fifo is not full [0] tfe r 0y1 transmit fifo empty flag: 0y0: transmit fifo is not empty 0y1: transmit fifo is empty a ddress = (0x400c_0000) + 0x000c a ddress = (0x400c_1000) + 0x000c
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 22 / 28 - 14.4.9 ssp0cpsr (ssp0 clock prescale register) 14.4.10 ssp1cpsr (ssp1 clock prescale register) [explanation] a. clock prescale divider. must be an even number from 2 to 254, depending on the frequency of fsys. the least significant bit always returns zero on reads. bit bit symbol type reset value description [31:8] ? ? undefined read undefined. write as zero. [7:0] cpsdvsr r/w 0x00 clock prescale divider: set an even number from 2 to 254. bit bit symbol type reset value description [31:8] ? ? undefined read undefined. write as zero. [7:0] cpsdvsr r/w 0x00 cl ock prescale divider: set an even number from 2 to 254. a ddress = (0x400c_0000) + 0x0010 a ddress = (0x400c_1000) + 0x0010
tmpm380/m382 tmpm380/m382 - 23 / 28 - 14.4.11 ssp0imsc (ssp0 interrupt enable/disable register) 14.4.12 ssp1imsc (ssp1 interrupt enable/disable register) [explanation] a. enables/disables transmit interrupt b. enables/disables receive interrupt c. enables/disables timeout interrupt d. enables/disables receive overrun interrupt bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txim r/w 0y0 transmit fifo interrupt enable: 0y0: disable 0y1: enable [2] rxim r/w 0y0 receive fifo interrupt enable: 0y0: disable 0y1: enable [1] rtim r/w 0y0 receive timeout interrupt enable: 0y0: disable 0y1: enable [0] rorim r/w 0y0 receive overrun interrupt enable: 0y0: disable 0y1: enable bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txim r/w 0y0 transmit fifo interrupt enable: 0y0: disable 0y1: enable [2] rxim r/w 0y0 receive fifo interrupt enable: 0y0: disable 0y1: enable [1] rtim r/w 0y0 receive timeout interrupt enable: 0y0: disable 0y1: enable [0] rorim r/w 0y0 receive overrun interrupt enable: 0y0: disable 0y1: enable a ddress = (0x400c_0000) + 0x0014 a ddress = (0x400c_1000) + 0x0014
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 24 / 28 - 14.4.13 ssp0ris (ssp0 pre-enable interrupt status register) 14.4.14 ssp1ris (ssp1 pre-enable interrupt status register) bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txris r 0y1 pre-enable transmit interrupt flag: 0y0: interrupt not present 0y1: interrupt present [2] rxris r 0y0 pre-enable receive interrupt flag: 0y0: interrupt not present 0y1: interrupt present [1] rtris r 0y0 pre-enable receive timeout interrupt flag: 0y0: interrupt not present 0y1: interrupt present [0] rorris r 0y0 pre-enable receive overrun interrupt flag: 0y0: interrupt not present 0y1: interrupt present bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txris r 0y1 pre-enable transmit interrupt flag: 0y0: interrupt not present 0y1: interrupt present [2] rxris r 0y0 pre-enable receive interrupt flag: 0y0: interrupt not present 0y1: interrupt present [1] rtris r 0y0 pre-enable receive timeout interrupt flag: 0y0: interrupt not present 0y1: interrupt present [0] rorris r 0y0 pre-enable receive overrun interrupt flag: 0y0: interrupt not present 0y1: interrupt present a ddress = (0x400c_0000) + 0x0018 a ddress = (0x400c_1000) + 0x0018
tmpm380/m382 tmpm380/m382 - 25 / 28 - 14.4.15 ssp0mis (ssp0 post-enable interrupt status register) 14.4.16 ssp1mis (ssp1 post-enable interrupt status register) bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txmis r 0y0 post-enable transmit interrupt flag: 0y0: interrupt not present 0y1: interrupt present [2] rxmis r 0y0 post-enable receive interrupt flag: 0y0: interrupt not present 0y1: interrupt present [1] rtmis r 0y0 post-enable receive timeout interrupt flag: 0y0: interrupt not present 0y1: interrupt present [0] rormis r 0y0 post-enable receive overrun interrupt flag: 0y0: interrupt not present 0y1: interrupt present bit bit symbol type reset value description [31:4] ? ? undefined read undefined. write as zero. [3] txmis r 0y0 post-enable transmit interrupt flag: 0y0: interrupt not present 0y1: interrupt present [2] rxmis r 0y0 post-enable receive interrupt flag: 0y0: interrupt not present 0y1: interrupt present [1] rtmis r 0y0 post-enable receive timeout interrupt flag: 0y0: interrupt not present 0y1: interrupt present [0] rormis r 0y0 post-enable receive overrun interrupt flag: 0y0: interrupt not present 0y1: interrupt present a ddress = (0x400c_0000) + 0x001c a ddress = (0x400c_1000) + 0x001c
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 26 / 28 - 14.4.17 ssp0icr (ssp0 interrupt clear register) 14.4.18 ssp1icr (ssp1 interrupt clear register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] rtic w undefined clear the receive timeout interrupt flag: 0y0: do nothing 0y1: clear [0] roric w undefined clear the receive overrun interrupt flag: 0y0: do nothing 0y1: clear bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] rtic w undefined clear the receive timeout interrupt flag: 0y0: do nothing 0y1: clear [0] roric w undefined clear the receive overrun interrupt flag: 0y0: do nothing 0y1: clear a ddress = (0x400c_0000) + 0x0020 a ddress = (0x400c_1000) + 0x0020
tmpm380/m382 tmpm380/m382 - 27 / 28 - 14.4.19 ssp0dmacr (ssp0dma control register) 14.4.20 ssp1dmacr (ssp1dma control register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] txdmae r/w 0y0 transmit fifo dma control: 0y0: disable 0y1: enable [0] rxdmae r/w 0y0 receive fifo dma control: 0y0: disable 0y1: enable bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] txdmae r/w 0y0 transmit fifo dma control: 0y0: disable 0y1: enable [0] rxdmae r/w 0y0 receive fifo dma control: 0y0: disable 0y1: enable a ddress = (0x400c_0000) + 0x0024 a ddress = (0x400c_1000) + 0x0024
14 ssp (synchronous serial port) tmpm380/m382 tmpm380/m382 - 28 / 28 - ? notes related to specifications (1) when correct data reception is disturbed due to clock phase shift during reception: after disabling ssp, clearing all data in the receive fifo and then enabling ssp again will restore the correct reception status. example: how to restore a receive data error (ssp0cr1) ((ssp0cr1)&(0xfff ffffd)) ; set "0" to ssp0cr1. sync serial port disable (gpioafr1) ((gpioafr1)&(0xfffffff0)) ; set "0" to gpioafr1. port a ssp0 function disable while((ssp0sr)&0x00000004)!=0x00000000){ reg (ssp0dr)} ; read (rne="0")ssp0dr until the receive fifo becomes empty. (gpioafr1) ((gpioafr1)|(0x0000000f)) ; set "1" to gpioafr1. port a ssp0 function enable (ssp0cr1) ((ssp0cr1)|(0x00000002)) ; set "1" to ssp0cr1. sync serial port enable
tmpm380/m382 tmpm380/m382 - 1 / 41 - 15 serial bus interface (i2c/sio) the tmpm380 contains two serial bus interface (sbi) channels and tmpm382 contains one serial bus interface (sbi) channel, in which th e following two operating modes are included: ? i 2 c bus mode (with mult i-master capability) ? clock-synchronous 8-bit sio mode in the i 2 c bus mode, the sbi is connected to external devices via scl and sda. in the clock-synchronous 8-bit sio mode, the sbi is c onnected to external devices via sck, si and so. the following table shows the programming requi red to put the sbi in each operating mode. as for the channel 1, it is available for only tmpm380. channel operation mode pin name function control register output control register input enable control register open drain control register i 2 c bus mode scl0: pc1 sda0: pc0 pcfr3<1:0> = 11 pccr<1:0> = 11 pcie<1:0> = 11 pcod<1:0> = 11 sbi0 sio mode sck0: pc2 si0 : pc1 so0 : pc0 pcfr3<2:0> = 111 pccr<2:0> = 101(sck0output) pccr<2:0> = 001( sck0 input) pcie<2:0> = 110 pcod<2:0> = xxx i 2 c bus mode scl1: pg1 sda1: pg0 pgfr3<1:0> = 11 pgcr<1:0> = 11 pgie<1:0> = 11 pgod<1:0> = 11 sbi1 (only for tmpm380) sio mode sck1: pg2 si1 : pg1 so1 : pg0 pgfr3<2:0> = 111 pgcr<2:0> = 101(sck1 output) pgcr<2:0> = 001(sck1 input) pgie<2:0> = 110 pgod<2:0> = xxx x: don?t care important tmpm382(64 pin version prod uct) do not have sbi1. please do not use these function if you use this product.
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 2 / 41 - 15.1 configuration the configuration is shown in fig 15-1 . fig 15-1 sbi block dia gram i 2 c bus clock synchroni- zation + control noise cancelle r shift register sbicr2 sbisr sbidbr intsbi0 interru p t re q uest fsys sbi control register 2/ sbi status register i 2 c bus address register sbi data buffer register sbi control registers 0,1 sbi baud rate register 0 sda so si scl sck sck sda scl so si sio clock control frequency divider transfer control circuit sbicr0,1 sbibr0 sbii2car noise cancelle r i 2 c bus data control sio data control input/ output control
tmpm380/m382 tmpm380/m382 - 3 / 41 - 15.2 control the following registers control the serial bus in terface and provide its status information for monitoring. ? serial bus interface cont rol registers 0 (sbincr0) ? serial bus interface cont rol registers 1 (sbincr1) ? serial bus interface cont rol registers 2 (sbincr2) ? serial bus interface buffer registers (sbindbr) ? i 2 c bus address register (sbini2car) ? serial bus interface status registers (sbinsr) ? serial bus interface baud rate registers 0 (sbinbr0) the functions of these registers vary, depending on the mode in which the sbi is operating. for a detailed description of the registers, refer to ? 15.5 control in the i2c bus mode ? an d ? 15.7 serial bus interface (i2c/sio) ?. the ad dre sses of each register are shown below. channel 0 channel 1 serial bus interface control register 0 sbi0cr0 0x4002_0000 sbi1cr0 0x4002_0020 serial bus interface control register 1 sbi0cr1 0x4002_0004 sbi1cr1 0x4002_0024 serial bus interface control register 2 sbi0cr2 (writing) sbi1cr2 (writing) serial bus interface status register sbi0sr (reading) 0x4002_0010 sbi1sr (reading) 0x4002_0030 serial bus interface baud rate register 0 sbi0br0 0x4002_0014 sbi1br0 0x4002_0034 serial bus interface data buffer register sbi0dbr 0x4002_0008 sbi1dbr 0x4002_0028 register name (address) i 2 c bus address register sbi0i2car 0x4002_000c sbi1i2car 0x4002_002c
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 4 / 41 - 15.3 i2c bus mode data formats fig 15-2 shows the data formats used in the i 2 c bus mode. fig 15-2 i 2 c bus mode data formats note) s: start condition w/r : direction bit ack: acknowledge bit p: stop condition r / w r / w s (a) addressing format (b) addressing format (with repeated start condition) (c) free data format (master-tr ansmitter to slave-receiver) slave address data p s s s p p 8-bits 1~8-bits 1 once re p eated 1~8-bits a c k slave address data data once once a c k a c k 8-bits 1~8-bits 1~8-bits 11 1 1 1 1 8-bits 1~8-bits 1~8-bits data data data data a c k 1 1 1 slave address re p eated once re p eated re p eated r / w a c k a c k a c k a c k a c k a c k 8-bits
tmpm380/m382 tmpm380/m382 - 5 / 41 - 15.4 control registers in the i2c bus mode the following registers control the serial bus interface (sbi) in the i 2 c bus mode and provide its status information for monitoring. serial bus control register 0 7 6 5 4 3 2 1 0 bit symbol sbien read/write r/w r after reset 0 0 function sbi operation 0: disable 1: enable this can be read as ?0.? 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0.? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0.? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0.? : to use the sbi, enable the sbi operation (?1?) before setting each register in the sbi module. for the first time in case of setting to enable, the relevant sbi register s can be read or written. fig 15-3 i 2 c bus mode register sbincr0
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 6 / 41 - serial bus control register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon read/write r/w r/w r r/w r/w after reset 0 0 0 0 1 0 0 1 function select the number of bits per transfer (note 1) acknowled gment clock 0: not generate 1: generate this can be read as ?1.? select internal scl output clock frequency (note 2) and reset monitor. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0.? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0.? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0.? : select internal scl output clock frequency on writing : select internal scl output clock frequency 000 001 010 011 100 101 110 111 n=5 n=6 n=7 n=8 n=9 n=10 n=11 384 khz 294 khz 200 khz 122 khz 68 khz 36 khz 19 khz reserved system clock: fsys (=40 mhz) clock gear : fc/1 frequency = [ hz ] < swrmon>: software reset status monitor on reading : software reset status monitor 0 software reset operation is in progress. 1 software reset operation is not in progress. : select the number of bits per transfer select the number of bits per transfer when = 0 when = 1 number of clock cycles data length number of clock cycles data length 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 fig 15-4 i 2 c bus mode register sbincr1 fsys 2 n +72
tmpm380/m382 tmpm380/m382 - 7 / 41 - (note 1) clear to ?000? before switching the operation mode to the clock-synchronous 8-bit sio mode. (note 2) for details on the scl line clock frequency, refer to ? 15.5.3 serial bus interface (i2c/sio) .? (no te 3) after a reset, the bit is read as ?1.? however, if the sio mode is selected at the sbincr2 register, the init ial value of the bit is ?0.? (note 4) initial value for frequency select is =000, and there is no relation to the initial reading value.
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 8 / 41 - serial bus control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 read/write w w (note 2) w (note 1) after reset 0 0 0 1 0 0 0 0 function select master/slave 0: slave 1: master select transmit/ receive 0: receive 1: transmit start/stop condition generation 0: stop condition generated 1: start condition generated clear intsbin interrupt request 0: ? 1: clear interrupt request select serial bus interface operating mode (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved)) software reset generation write ?10? followed by ?01? to generate a reset. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0.? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0.? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0.? : write ?10? followed by ?01? to generate a reset. : select serial bus interface operating mode select serial bus interface operating mode (note 2) 00 port mode (disables serial bus interface output) 01 clock ?synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) : clear intsbin interrupt request : start/stop condition generation : select transmit/ receive : select master/slave (note 1) reading this register causes it to function as the sbinsr register. (note 2) ensure that the bus is free before switching the operating mode to the port mode. ensure that the port is at the ?h? level before switching the operating mode from the port mode to the i 2 c bus or clock-synchronous 8-bit sio mode. (note 3) ensure that serial transfer is completed before switching the mode. fig 15-5 i 2 c bus mode register sbincr2
tmpm380/m382 tmpm380/m382 - 9 / 41 - table 15-1 base clock resolution @fsys = 40 mhz clock gear value base clock resolution 00 (fc) fsys/2 2 (0.1 us) 01 (fc/2) fsys/2 3 (0.2 us) 10 (fc/4) fsys/2 4 (0.4 us) 11 (fc/8) fsys/2 5 (0.8 us)
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 10 / 41 - serial bus interface status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ado lrb read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave selection monitor 0: slave 1: master transmit/ receive selection monitor 0: receive 1: transmit i 2 c bus state monitor 0: free 1: busy intsbin interrupt request monitor 0: interrupt request generated 1: interrupt request cleared arbitration lost detection 0: ? 1: detected slave address match detection 0: ? 1: detected general call detection 0: ? 1: detected last received bit monitor 0: ?0? 1: ?1? 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0.? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0.? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0.? (note) writing to this register ca uses it to function as sbincr2. fig 15-6 i 2 c bus mode register last received bit monitor general call detection slave address match detection arbitration lost detection intsbin interrupt request monitor i 2 c bus state monitor transmit/ receive selection monitor master/ slave selection monitor sbinsr
tmpm380/m382 tmpm380/m382 - 11 / 41 - serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 bit symbol i2sbi read/write r r/w r r/w after reset 1 0 1 0 function this can be read as ?1?. idle 0: stop 1:operate this can be read as ?1?. be sure to write ?0.? (note) 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. : operation at the idle mode sbinbr0
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 12 / 41 - serial bus interface data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 read/write r (receive)/w (transmit) after reset 0 function rx data/ tx data. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. (note1) the transmission data must be written in to the register from the msb (bit 7). the received data is stored in the lsb. (note2) since sbixi2car has independent buffers for writing and reading, a written data cannot be read. thus, read-modify-write instructions, such as bit manipulation, cannot be used. sbindbr
tmpm380/m382 tmpm380/m382 - 13 / 41 - i 2 c bus address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als read/write r/w after reset 0 0 0 0 0 0 0 0 function set the slave address when the sbi acts as a slave device. specify address recognition mode 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. : specify address recognition mode (note1) please set the bit 0 of i2c bus address register sbini2car to ?0?, except when you use a free data format. it operates as a free data format when setting it to ?1?. selecting the master fixes to transmission. selecting the slave fixes to reception. (note2) do not set sbixi2car to "0x00" in slave mode. (if sbixi2car is set to "0x00", it's recognized that the slave address matches the start byte ("0x01") of the i2c standard received in slave mode.) fig 15-7 i 2 c bus mode register sbini2car
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 14 / 41 - 15.5 control in the i2c bus mode 15.5.1 setting the acknowledgement mode setting sbincr1 to ?1? selects the acknowledge mode. when operating as a master, the sbi adds one clock for acknowledgment signals. as a transmitter, the sbi releases the sda pin during this clock cycle to receive acknowledgment signals from the receiver. as a receiver, the sbi pulls the sda pin to the ?l? level during this clock cycle and generates acknowledgment signals. by setting to ?0?, the non-acknowledgmen t mode is activated. when operating as a master, the sbi does not generate clock for acknowledgement signals. 15.5.2 setting the number of bits per transfer sbincr1 specifies the number of bi ts of the next data to be transmitted or received. under the start condition, is set to ?000,? causing a slave address and the direction bit to be transferred in a packet of eight bits. at other times, keeps a previously programmed value. 15.5.3 serial clock c clock source sbincr1 specifies the maximum freq uency of the serial clock to be output from the scl pin in the master mode. fig 15-8 clock source t high t low 1/fscl t low = 2 n-1 /fsys + 58/ fsys t high = 2 n-1 / fsys + 14/ fsys fscl = 1/(t low + t high ) sbincr1 n 000 001 010 011 100 101 110 5 6 7 8 9 10 11 = fsys 2 n + 72 (note) the highest speeds in the standard and high-speed modes are specified to 100khz and 400khz respectively following the communications standards. note that the internal scl clock frequency is determined by the fsys used and the calculation formula shown above. ?
tmpm380/m382 tmpm380/m382 - 15 / 41 - d clock synchronization the i 2 c bus is driven by using the wired-and conne ction due to its pin structure. the first master that pulls its clock line to the ?l? leve l overrides other masters producing the ?h? level on their clock lines. this must be detected and responded by the masters producing the ?h? level. clock synchronization assures correct data transf er on a bus that has two or more master. for example, the clock synchronization proc edure for a bus with two masters is shown below. fig 15-9 example of clock synchronization at the point a, master a pulls its internal sc l output to the ?l? level, bringing the scl bus line to the ?l? level. master b detects this tr ansition, resets its ?h? level period counter, and pulls its internal scl output level to the ?l? level. master a completes counting of its ?l? level peri od at the point b, and brings its internal scl output to the ?h? level. however, master b still keeps the scl bus line at the ?l? level, and master a stops counting of its ?h? level period co unting. after master a detects that master b brings its internal scl output to the ?h? level and brings the scl bus line to the ?h? level at the point c, it starts counting of its ?h? level period. this way, the clock on the bus is determined by the master with the shortest ?h? level period and the master with the longest ?l? level period among those connected to the bus. 15.5.4 slave addressing and address recognition mode when the sbi is configured to operate as a slave device, the slave address and must be set at sbini2car. setting to ?0? selects the address recognition mode. 15.5.5 configuring the sbi as a master or a slave setting sbincr2 to ?1? configures the sbi to operate as a master device. setting to ?0? configures the sbi as a slave device. is cleared to ?0? by the hardware when it detects the stop conditi on on the bus or the arbitration lost. internal scl out p ut ( master a ) internal scl out p ut ( master b ) scl line reset high-level p eriod countin g wait for high-level p eriod countin g start high-level period counting a b c
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 16 / 41 - 15.5.6 configuring the sbi as a transmitter or a receiver setting sbincr2 to ?1? configures the sbi as a transmitter. setting to ?0? configures the sbi as a receiver. at the slave mode, the sbi re ceives the direction bit ( wr/ ) from the master device on the following occasions: ? when data is transmitted in the addressing format ? when the received slave address matc hes the value specified at i2ccr ? when a general-call address is received ; i.e., the eight bits following the start condition are all zeros if the value of the direction bit ( wr/ ) is ?1,? is set to ?1? by the hardware. if the bit is ?0,? is set to ?0?. as a master device, the sbi receives acknowledgement from a slave device. if the direction bit of ?1? is transmitted, is set to ?0? by the hardware. if the direction bit is ?0,? changes to ?1.? if the sbi does not receive acknowledgement, retains the previous value. is cleared to ?0? by the hardware when it detects the stop condition on the bus or the arbitration lost.
tmpm380/m382 tmpm380/m382 - 17 / 41 - 15.5.7 generating start and stop conditions when sbinsr is ?0,? writing ?1? to sbincr2 causes the sbi to generate the start condition on the bus and output 8-bit data. must be set to ?1? in advance. fig 15-10 generating the start condition and a slave address when is ?1,? writing ?1? to and ?0? to causes the sbi to start a sequence for generating the stop condition on the bus. the contents of should not be altered until the stop condition appears on the bus. fig 15-11 generating the stop condition sbinsr can be read to check the bus state. is set to ?1? when the start condition is detected on the bus (the bus is busy ), and set to ?0? when the stop condition is detected (the bus is free). scl line start condition a 6 slave address and direction bit a cknowledgement signal 1 sda line 234567 8 9 a 5 a 4 a 3 a 2 a 1 a 0 r/w sto p condition scl line sda line
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 18 / 41 - 15.5.8 interrupt service request and release when a serial bus interface interrupt request (intsbin) is generated, sbincr2 is cleared to ?0.? while is ?0,? t he sbi pulls the scl line to the ?l? level. after transmission or reception of one data word, is cleared to ?0.? it is set to ?1? when data is written to or read from sbindbr. it takes a period of t low for the scl line to be released after is set to ?1.? in the address recognition mode ( = ?0?), is cleared to ?0? when the received slave address matches the value specified at sbini2car or when a general-call address is received; i.e., the eight bits following the st art condition are all zeros. when the program writes ?1? to sbincr2, it is set to ?1.? however, writing ?0? does clear this bit to ?0?. 15.5.9 serial bus interface operating modes sbincr2 selects an operating mode of the serial bus interface. must be set to ?10? to configure the sbi for the i 2 c bus mode. make sure that the bus is free before switching the operating mode to the port mode. 15.5.10 lost-arbitration detection monitor the i 2 c bus has the multi-master capability (ther e are two or more masters on a bus), and requires the bus arbitration proce dure to ensure correct data transfer. a master that attempts to generate the start condition while the bus is busy loses bus arbitration, with no start condition occurring on the sda and scl lines. the i 2 c-bus arbitration takes place on the sda line. the arbitration procedure for two masters on a bus is shown below. up until the point a, master a and master b output the same data. at the point a, master a outputs the ?l? level and master b outputs the ?h? level. then master a pulls the sda bus line to the ?l? level because the line has the wired-and connection. when the scl line goes high at the point b, the slave device reads the sda line data, i.e., data transmitted by master a. at this time, data transmitted by master b becomes invalid. this condition of master b is called ?lost arbitration?. master b releases its sda pin, so that it does not affect the data transfer initiated by another master. if two or more masters have transmitted exactly the same first data word, the arbitration procedure continues with the second data word. fig 15-12 lost arbitration loses arbitration and sets the internal sda output to "1?. scl (line) internal sda output (mastera) internal sda output (master b) sda line ab
tmpm380/m382 tmpm380/m382 - 19 / 41 - a master compares the sda bus line level and the in ternal sda output level at t he rising of the scl line. if there is a difference between these two values, arbitr ation lost occurs and sbinsr is set to ?1?. when is set to ?1,? sbinsr are cleared to ?0,? causing the sbi to operate as a slave receiver. is cleared to ?0? when data is written to or read from sbindbr or data is written to sbincr2. fig 15-13 example of master b lost arbitration (d7a = d7b, d6a = d6b) 15.5.11 slave address match detection monitor when the sbi operates as a slave device in the address recognition mode (sbini2car = ?0?), sbinsr is set to ?1? on rece iving the general-call address or the slave address that matches the value sp ecified at sbini2car. when is ?1,? is set to ?1? when the first data word has been rece ived. is cleared to ?0? when data is written to or read from sbindbr. 15.5.12 general-call detection monitor when the sbi operates as a slav e device, sbinsr is set to ?1? when it receives the general-call address; i.e., the eight bits followi ng the start condition are all zeros. is cleared to ?0? when the start or stop condition is detected on the bus. 15.5.13 last received bit monitor sbinsr is set to the sda line value that was read at the rising of the scl line. in the acknowledgment mode, reading sbinsr immediately after generation of the intsbin interrupt request causes ack signal to be read. clock output stops here 1 internal sda output is fixed to ?h? due to arbitration lost of master b. a ccess to sbindbr or sbincr2 internal sclout p ut internal sda out p ut internal sda output internal scl out p ut master a master b 23456789 1 2 34 d7a d6b d5a d4a d3a d2a d1a d0a d7a? d6a? d5a? d4a? 1 234 d7b d6a
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 20 / 41 - 15.5.14 software reset if the serial bus interface circuit locks up due to external noise, it can be initialized by using a software reset. writing ?10? followed by ?01? to sbincr2 generates a reset signal that initializes the serial bus interface circuit. after a reset, all control registers and status flags are initialized to their reset values. when the serial bus interface is initialized, is automatically cleared to ?0?. (note) a software reset causes the sbi operating mode to switch from the i 2 c mode to the port mode. 15.5.15 serial bus interface data buff er register (sbindbr) reading or writing sbindbr initiates reading received data or writing transmitted data. when the sbi is acting as a master, setting a slave address and a direction bit to this register generates the start condition. 15.5.16 i2c bus address register (sbini2car) when the sbi is configured as a slave device , the sbini2car bit is used to specify a slave address. if sbini2car is se t to ?0,? the sbi recognizes a slave address transmitted by the master device and receives data in the addressing format. if is set to ?1,? the sbi does not recognize a slave address and receives data in the free data format. 15.5.17 baud rate register (sbinbr0) the sbinbr0 register deter mines if the sbi operates or not when it enters the idle mode. this register must be programmed befor e executing an instruction to switch to the standby mode.
tmpm380/m382 tmpm380/m382 - 21 / 41 - 15.6 data transfer procedure in the i2c bus mode 15.6.1 device initialization first, program sbincr1 by wr iting ?0? to bits 7 to 5 in sbincr1. next, program sbini2car by specifying a slave address at and an address recognition mode at . ( must be se t to?0? when using the addressing format). then program sbincr2 to initially configure t he sbi in the slave receiver mode by writing ?0? to , ?1? to , ?10? to and ?0? to bits 1 and 0. 7 6 5 4 3 2 1 0 sbincr1 0 0 0 x 0 x x x specifies ack and scl clock. sbini2car x x x x x x x x specifies a slave address and an address recognition mode. sbincr2 0 0 0 1 1 0 0 0 configures the sbi as a slave receiver. (note) x: don?t care
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 22 / 41 - 15.6.2 generating the start condi tion and a slave address c master mode in the master mode, the following steps are required to generate the start condition and a slave address. first, ensure that the bus is free ( = ?0?). then, write ?1? to sbincr1 to select the acknowledgment mode. write to sbindbr a slave address and a direction bit to be transmitted. when = ?0,? writing ?1111? to sbincr2 generates the start condition on the bus. following the st art condition, the sbi generates nine clocks from the scl pin. the sbi outputs the slav e address and the direction bit specified at sbindbr with the first eight clocks, and releases the sda line in the ninth clock to receive an acknowledgment signal from the slave device. the intsbin interrupt request is generated on the falling of the ninth clock, and is cleared to ?0.? in the master mode, t he sbi holds the scl line at the ?l? level while is ?0.? changes its value acco rding to the transmitted direction bit at generation of the intsbin interrupt reques t, provided that an acknowledgment signal has been returned from the slave device. settings in main routine 7 6 5 4 3 2 1 0 reg. sbisr reg. reg. e 0x20 if reg. 0x00 ensures that the bus is free. then sbincr1 x x x 1 0 x x x selects the acknowledgement mode. sbindbr x x x x x x x x specifies the desired slave address and direction. sbincr2 1 1 1 1 1 0 0 0 generates the start condition. example of intsbin interrupt routine clears the interrupt request. processing end of interrupt
tmpm380/m382 tmpm380/m382 - 23 / 41 - d slave mode in the slave mode, the sbi receives the start condition and a slave address. after receiving the start condition from the master device, the sbi receives a slave address and a direction bit from the master device during the first eight clocks on the scl line. if the received address matches its slave address spec ified at sbini2car or is equal to the general-call address, the sbi pulls the sda line to the ?l? level during the ninth clock and outputs an acknowledgment signal. the intsbin interrupt request is generated on the falling of the ninth clock, and is cleared to ?0.? in the slave mode, the sbi holds the scl line at the ?l? level while is ?0?. (note) the user can only use a dma transfer: ? when there is only one master and only one slave and ? continuous transmission or reception is possible. fig 15-14 generation of the star t condition and a slave address scl start condition a 6 slave address + direction bit acknowledgement from slave 1 sda 2 34567 8 9 a 5 a 4 a 3 a 2 a 1 a 0 wr/ intsbin interrupt request ack master output slave output
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 24 / 41 - 15.6.3 transferring a data word at the end of a data word transfer, the intsbi n interrupt is generated to test to determine whether the sbi is in the master or slave mode. c master mode ( = ?1?) test to determine whether the sbi is configured as a transmitter or a receiver. transmitter mode ( = ?1?) test . if is ?1,? that means the receiver requires no further data. the master then generates the stop condition as described later to stop transmission. if is ?0,? that means the receiver r equires further data. if the next data to be transmitted has eight bits, the data is written into sbindbr. if the data has different length, and are programmed and the transmit data is written into sbindbr. writing the data makes to ?1,? causing the scl pin to generate a serial clock for transferring a next data word, and the sda pin to transfer the data word. after the transfer is completed, the intsbin interrupt request is generated, is set to ?0,? and the scl pin is pulled to the ?l? level. to transmit more data words, test again and repeat the above procedure. intsbin interrupt if mst = 0 then go to the slave-mode processing if trx = 0 then go to the receiver-mode processing if lrb = 0 then go to processing for generating the stop condition sbincr1 x x x x 0 x x x specifies the number of bits to be transmitted and specify whether ack is required. sbindbr x x x x x x x x writes the transmit data. end of interrupt processing (note) x: don?t care fig 15-15 = ?000? and = ?1? (transmitter mode) scl pin write to sbindbr d7 a cknowledgment signal from receiver 1 sda pin 2 345678 9 d6 d5 d4 d3 d2 d1 intsbin interrupt re q uest a ck master output slave output d0
tmpm380/m382 tmpm380/m382 - 25 / 41 - receiver mode ( = ?0?) if the next data to be transmitted has eight bits, the transmit data is written into sbindbr. if the data has different length, and are programmed and the received data is read from sbindbr to release the scl line. (the data read immediately after transmission of a slave address is undefined.) on reading the data, is set to ?1,? and the serial clock is output to the scl pin to tr ansfer the next data word. in the last bit, when the acknowledgment signal becomes the ?l? level, ?0? is output to the sda pin. after that, the intsbin interrupt request is generated, and is cleared to ?0,? pulling the scl pin to the ?l? level. each time the received data is read from sbindbr, one-word transfer clock and an acknowledgement signal are output. fig 15-16 = ?000? and = ?1? (receiver mode) to terminate the data transmission from the transmitter, must be set to ?0? immediately before reading the data word second to last. this disables generation of an acknowledgment clock for the last data word. when the transfer is completed, an interrupt request is generated. after the interrupt processing, must be set to ?001? and the data must be read so that a clock is generated fo r 1-bit transfer. at this time, the master receiver holds the sda bus line at the ?h? le vel, which signals the end of transfer to the transmitter as an acknowledgment signal. in the interrupt processing for terminating the reception of 1-bit data, the stop condition is generated to terminate the data transfer. fig 15-17 terminating data transmission in the master receiver mode scl d7 a cknowledgment signal to transmitter ?h? 1 sda 2 345678 1 d6 d5 d4 d3 d2 d1 intsbin interrupt request master output slave output d0 read out the received data after clearing to "0?. 9 read out the received data after setting to "001." scl d7 a cknowledgment signal from receiver 1 sda 2 345678 9 d6 d5 d4 d3 d2 d1 intsbin interrupt request a ck master output slave output d0 read the received data next d7
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 26 / 41 - example: when receiving n data word intsbin interrupt (after data transmission) 7 6 5 4 3 2 1 0 sbincr1 x x x x 0 x x x sets the number of bits of data to be received and specify whether ack is required. reg. sbindbr reads dummy data. end of interrupt intsbin interrupt (first to (n-2)th data reception) 7 6 5 4 3 2 1 0 reg. sbindbr reads the first to (n-2)th data words. end of interrupt intsbin interrupt ((n-1)th data reception) 7 6 5 4 3 2 1 0 sbincr1 x x x 0 0 x x x disables generation of acknowledgement clock. reg. sbindbr reads the (n-1)th data word. end of interrupt intsbin interrupt (nth data reception) 7 6 5 4 3 2 1 0 sbincr1 0 0 1 0 0 x x x disables generation of acknowledgement clock . reg. sbindbr reads the nth data word. end of interrupt intsbin interrupt (after completing data reception) processing to generate the stop condition. terminates the data transmission. end of interrupt (note) x: don?t care
tmpm380/m382 tmpm380/m382 - 27 / 41 - d slave mode ( = ?0?) in the slave mode, the sbi generates the intsbi n interrupt request on four occasions: 1) when the sbi has received any slave addre ss from the master, 2) when the sbi has received a general-call addres s, 3) when the received slav e address matches its own address, and 4) when a data transfer has been completed in response to a general-call. also, if the sbi detects arbitration lost in the master mode, it switches to the slave mode. upon the completion of data word transfer in wh ich arbitration lost is detected, the intsbin interrupt request is generated, is cleare d to ?0,? and the scl pin is pulled to the ?l? level. when data is written to or read from sbindbr or when is set to ?1,? the scl pin is released after a period of t low . in the slave mode, the normal slave mode proc essing or the processing as a result of arbitration lost is carried out. sbinsr , , and are tested to determine the processing required. table 15-2 shows the sl ave mode states and required processing. example: when the received slave address matches the sbi's own address and the direction bit is ?1? in the slave receiver mode. intsbin interrupt if trx = 0 then go to other processing if al = 1 then go to other processing if aas = 0 then go to other processing sbincr1 x x x 1 0 x x x sets the number of bits to be transmitted. sbindbr x x x x 0 x x x sets the transmit data. (note) x: don?t care
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 28 / 41 - table 15-2 processing in slave mode state processing 1 1 0 arbitration lost is detected while the slave address was being transmitted and the sbi received a slave address with the direction bit ?1? transmitted by another master. 1 0 in the slave receiver mode, the sbi received a slave address with the direction bit ?1? transmitted by the master. set the number of bits in a data word to and write the transmit data into sbindbr. 1 0 0 0 in the slave transmitter mode, the sbi has completed a transmission of one data word. test lrb. if it has been set to ?1,? that means the receiver does not require further data. set to 1 and reset to 0 to release the bus. if has been reset to ?0,? that means the receiver requires further data. set the number of bits in the data word to and write the transmit data to the sbindbr. 1 1/0 arbitration lost is detected while a slave address is being transmitted, and the sbi receives either a slave address with the direction bit ?0? or a general-call address transmitted by another master. 1 0 0 arbitration lost is detected while a slave address or a data word is being transmitted, and the transfer is terminated. 1 1/0 in the slave receiver mode, the sbi received either a slave address with the direction bit ?0 ? or a general-call address transmitted by the master. read the sbindbr (a dummy read) to set to 1, or write ?1? to . 0 0 0 1/0 in the slave receiver mode, the sbi has completed a reception of a data word. set the number of bits in the data word to and read the received data from sbindbr.
tmpm380/m382 tmpm380/m382 - 29 / 41 - 15.6.4 generating the stop condition when sbinsr is ?1,? writing ?1? to sbincr2 and ?0? to causes the sbi to start a sequence for genera ting the stop condition on the bus. do not alter the contents of until the stop condition appears on the bus. if another device is holding down the scl bus line, the sbi waits until the scl line is released. after that, the sda pin goes high, causing the stop condition to be generated. 7 6 5 4 3 2 1 0 sbincr2 1 1 0 1 1 0 0 0 generates the stop condition. fig 15-18 generating the stop condition scl pin sda pin < pin > ( read ) stop condition ?1? ?1? ?0? ? 1 ? < pin >
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 30 / 41 - 15.6.5 restart procedure restart is used when a master device chang es the data transfer direction without terminating the transfer to a slave device. the procedure of generating a restart in the master mode is described below. first, set sbincr2 to ?0? and writ e ?1? to to release the bus. at this time, the sda pin is held at the ?h? level and the scl pin is released. because no stop condition is generated on the bus, other devices recognize that the bus is busy. then, test sbinsr and wait until it becomes ?0? to ensure that the scl pin is released. next, test and wait until it bec omes ?1? to ensure that no ot her device is pulling the scl bus line to the ?l? level. once the bus is determined to be free this way, use the above-mentioned steps 15.6.2 to generate the start condition. t o satisfy the setup time of restart, at least 4.7- s wait period (in the standard mode) must be created by the software after the bus is determined to be free. 7 6 5 4 3 2 1 0 sbincr2 0 0 0 1 1 0 0 0 releases the bus. if sbinsr 0 checks that the scl pin is released. then if sbinsr 1 checks that no other device is pulling the scl pin to the ?l? level. then 4.7 s wait sbincr1 x x x 1 0 x x x selects the acknowledgment mode. sbindbr x x x x x x x x sets the desired slave address and direction. sbincr2 1 1 1 1 1 0 0 0 generates the start condition. (note) x: don?t care (note) do not write to ?0? when it is ?0.? (restart cannot be initiated.) fig 15-19 timing chart of generating a restart ?0? ?0? ?0? ?1? ?1? ?1? ?1? ?1? scl (bus) scl pin sda pin 4.7 s (min.) start condition 9
tmpm380/m382 tmpm380/m382 - 31 / 41 - 15.7 control in the clock-sy nchronous 8-bit sio mode the following registers control the serial bus inte rface in the clock-synchronous 8-bit sio mode and provide its status information for monitoring. serial bus interface control register 0 7 6 5 4 3 2 1 0 bit symbol sbien read/write r/w r after reset 0 0 function sbi operation 0: disable 1: enable this can be read as ?0.? 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0.? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0.? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0.? : to use the sbi, enable the sbi operation (? 1?) before setting each register of sbi module. fig 15-20 sio mode registers sbincr0
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 32 / 41 - serial bus interface control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 sck2 sck1 sck0 read/write r/w r r/w after reset 0 0 0 0 1 0 0 0 function start transfer 0: stop 1: start transfer 0: continue 1: forced terminatio n select transfer mode 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode this can be read as ?1?. select serial clock frequency 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. on writing : select serial clock frequency 000 001 010 011 100 101 110 111 n = 3 n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 ? 2.5 1.25 625 313 156 78 39 mhz mhz khz khz khz khz khz system clock : fsys (=40 mhz) clock gear : fc/1 frequency = [ hz ] fig 15-21 sio mode registers external clock (note) set to "0" and to "1" before programming the transfer mode and the serial clock. fs y s/2 2 n sbincr1
tmpm380/m382 tmpm380/m382 - 33 / 41 - serial bus interface data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 read/write r (receive)/w (transmit) after reset undefined function rx data/ tx data 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r ?? 0 C ? this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. serial bus interface control register 2 7 6 5 4 3 2 1 0 bit symbol sbim1 sbim0 read/write r w r after reset 1 0 0 1 function this can be read as ?1?. select serial bus interface operating mode 00: port mode 01: clock-synchronous 8-bit sio mode 10: i 2 c bus mode 11: (reserved) this can be read as ?1?. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. fig 15-22 sio mode registers sbindbr sbincr2
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 34 / 41 - serial bus interface register 7 6 5 4 3 2 1 0 bit symbol siof sef read/write r r r after reset 1 0 0 1 function this can be read as ?1?. serial transfer status monitor 0: completed 1: in progress shift operation status monitor 0: completed 1: in progress this can be read as ?1?. 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0?. 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0?. 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0?. serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 bit symbol i2sbi read/write r r/w r r/w after reset 1 0 1 0 function this can be read as ?1?. idle 0: stop 1: operate this can be read as ?1?. make sure to write ?0.? 15 14 13 12 11 10 9 8 bit symbol read/write r after reset 0 function this can be read as ?0? 23 22 21 20 19 18 17 16 bit symbol read/write r after reset 0 function this can be read as ?0? 31 30 29 28 27 26 25 24 bit symbol read/write r after reset 0 function this can be read as ?0? fig 15-23 sio mode registers sbinsr sbinbr0
tmpm380/m382 tmpm380/m382 - 35 / 41 - 15.7.1 serial clock c clock source internal or external clocks can be sele cted by programming sbincr1 . internal clocks in the internal clock mode, one of the se ven frequencies can be selected as a serial clock, which is output to the outside thro ugh the sck pin. at the beginning of a transfer, the sck pin output becomes the ?h? level. if the program cannot keep up with this serial clock rate in writing the transmit data or reading the received data, the sbi automatic ally enters a wait period. during this period, the serial clock is stopped autom atically and the next shift operation is suspended until the processing is completed. fig 15-24 automatic wait external clock ( = ?111?) the sbi uses an external clock supplied from the outside to the sck pin as a serial clock. for proper shift operations, the seri al clock at the ?h? and ?l? levels must have the pulse widths as shown below. fig 15-25 maximum transfer freq uency of external clock input sck pin output so pin output write the transmit data 3 1 7 2 81 2 67 8 1 2 3 c 0 a b c automatic wait a 0 a 1 a 2 a 5 a 6 a 7 b 0 b 5 b 6 b 7 c 1 c 2 b 1 b 4 t sck h t sckl , t sckh > 4/fsys sck pin t sck l
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 36 / 41 - d shift edge leading-edge shift is used in transmission. trailing-edge shift is used in reception. leading-edge shift data is shifted at the leading edge of the serial clock (or the falling edge of the sck pin input/output). trailing-edge shift data is shifted at the trailing edge of the serial clock (or the rising edge of the sck pin input/output). fig 15-26 shift edge bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 76543210 * 7654321 ** 765432 *** 76543 **** 7654 *****765 ******76 ******7 so pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 6543210 * 543210 ** 0 ******* 10****** 210 ***** 3210 **** 43210 *** ******** 76543210 sck pin shift register sck pin si pin shift register (a) leading-edge shift (b) trailing-edge shift (note) * ; don?t care
tmpm380/m382 tmpm380/m382 - 37 / 41 - 15.7.2 transfer modes the transmit mode, the receive mode or the transmit/receive mode can be selected by programming sbincr1 . c 8-bit transmit mode set the control register to the transmit mode and write the transmit data to sbindbr. after writing the transmit data, writing ?1? to sbincr1 starts the transmission. the transmit data is moved from sbindbr to a shift register and output to the so pin, with the least-significant bit (lsb) first, in sy nchronization with the serial clock. once the transmit data is transferred to the shif t register, sbindbr becomes empty, and the intsbin (buffer-empty) interrupt is gene rated, requesting the next transmit data. in the internal clock mode, the serial cl ock will be stopped and automatically enter the wait state, if next data is not loaded after the 8-bit data has been fully transmitted. the wait state will be cleared when sbindbr is loaded with the next transmit data. in the external clock mode, sbindbr must be loaded with data before the next data shift operation is started. therefore, the data tr ansfer rate varies depending on the maximum latency between when the interrupt request is generated and when sbindbr is loaded with data in the interrupt service program. at the beginning of transmission, the same va lue as in the last bit of the previously transmitted data is output in a period from setting sbinsr to ?1? to the falling edge of sck. transmission can be terminated by clearing to ?0? or setting to ?1? in the intsbin interrupt service program. if is cleared, remaining data is output before transmission ends. the program ch ecks sbinsr to determine whether transmission has come to an end. is cl eared to ?0? at the end of transmission. if is set to ?1,? the transmission is aborted immediately and is cleared to ?0?. in the external clock mode, must be set to ?0? before the next transmit data shift operation is started. otherwise, operation will stop after dummy data is transmitted. 7 6 5 4 3 2 1 0 sbincr1 0 1 0 0 0 x x x selects the transmit mode. sbindbr x x x x x x x x writes the transmit data. sbincr1 1 0 0 0 0 x x x starts transmission. intsbin interrupt sbindbr x x x x x x x x writes the transmit data.
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 38 / 41 - fig 15-27 transmit mode example: example of programming (external cl ock) to terminate transmission by 7 6 5 4 3 2 1 0 if sbisr 0 recognizes the completion of the transmission. then if sck 1 recognizes ?1? is set to the sck pin by monitoring the port. then sbincr1 0 0 0 0 0 1 1 1 completes the transmission by setting = 0. sbindbr intsbin interrupt request sck pin (output) so pin b a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * is cleared. a write the transmit data (a) internal clock sbindbr intsbin interrupt request sck pin (input) so pin b a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * is cleared. a write the transmit data (b) external clock
tmpm380/m382 tmpm380/m382 - 39 / 41 - d 8-bit receive mode set the control register to the receive mode. then writing ?1? to sbincr1 enables reception. data is taken into the shift register from the si pin, with the least-significant bit (lsb) first, in synchronization with the serial clo ck. once the shift register is loaded with the 8-bit data, it transfers the received data to sbi ndbr and the intsbin (buffer-full) interrupt request is generated to request reading the re ceived data. the inte rrupt service program then reads the received data from sbindbr. in the internal clock mode, the serial clock will be stopped and automatically be in the wait state until the received data is read from sbindbr. in the external clock mode, shift operations are executed in synchronization with the external clock. the maximum data transfer rate varies, depending on the maximum latency between generating the interrupt re quest and reading the received data. reception can be terminated by clearing to ?0? or setting to ?1? in the intsbin interrupt service program. if is cleared, reception continues until all the bits of received data are written to sbindbr . the program checks sbinsr to determine whether reception has come to an end. is cleared to ?0? at the end of reception. after confirming the completion of the reception, last received data is read. if is set to ?1,? the reception is abo rted immediately and is cleared to ?0.? (the received data becomes invalid, and there is no need to read it out.) (note) the contents of sbindbr will not be retained after the transfer mode is changed. the ongoing reception must be completed by clearing to ?0? and the last received data must be read before the transfer mode is changed. 7 6 5 4 3 2 1 0 sbincr1 0 1 1 1 0 x x x selects the receive mode. sbincr1 1 0 1 1 0 0 0 0 starts reception. intsbin interrupt reg. sbindbr reads the received data.
15 serial bus interface (i2c/sio) tmpm380/m382 tmpm380/m382 - 40 / 41 - fig 15-28 receive mode (example: internal clock) e 8-bit transmit/receive mode set the control register to the transfer/receive mode. then writing the transmit data to sbindbr and setting sbincr1 to ?1? enables transmission and reception. the transmit data is output through the so pin at the falling of the serial clock, and the received data is taken in through the si pin at the rising of the serial clock, with the least-significant bit (lsb) first. once the shift register is loaded wi th the 8-bit data, it transfers the received data to sbindbr and the intsbin interrupt request is generated. the interrupt service program reads the received data from the data buffer r egister and writes the next transmit data. because sbindbr is shared between transmit and receive operations, the received data must be read before the next transmit data is written. in the internal clock operation, the serial clo ck will be automatically in the wait state until the received data is read and the next transmit data is written. in the external clock mode, shift operations are executed in synchronization with the external serial clock. therefore, the re ceived data must be read and the next transmit data must be written before the next shift operation is started. the maximum data transfer rate for the external clock operation varies depending on the maximum latency between when the interrupt request is generated and when the transmit data is written. at the beginning of transmission, the same va lue as in the last bit of the previously transmitted data is output in a period from se tting to ?1? to the falling edge of sck. transmission and reception can be terminated by clearing to ?0? or setting sbincr1 to ?1? in the intsbin interrupt service program. if is cleared, transmission and reception continue until the re ceived data is fully transferred to sbindbr. the program checks sbinsr to det ermine whether transmission and reception have come to an end. is cleared to ?0? at the end of transmission and reception. if is set, the transmission and recept ion are aborted immediately and is cleared to ?0.? (note) the contents of sbindbr will not be retained after the transfer mode is changed. the ongoing transmission and reception must be completed by clearing to ?0? and the last received data must be read before the transfer mode is changed. sbindbr intsbin interrupt request sck pin (output) si pin b is cleared. a a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 read the received data read the received data
tmpm380/m382 tmpm380/m382 - 41 / 41 - fig 15-29 transmit/receive mode (example: internal clock) 7 6 5 4 3 2 1 0 sbincr1 0 1 1 0 0 x x x selects the transmit mode. sbindbr x x x x x x x x writes the transmit data. sbincr1 1 0 1 0 0 x x x starts reception/transmission. intsbin interrupt reg. sbindbr reads the received data. sbindbr x x x x x x x x writes the transmit data. ? data retention time of the la st bit at the end of transmission under the condition sbixcr1= "0", the last bit of the transmitted data retains the data of sck rising edge as shown below. transmit mode and transmit/receive mode are the same. fig 15-30 data retention time of the last bit at the end of transmission sbindbr intsbi interrupt request sck pin (output) so pin si pin is cleared. c 0 c 1 c 2 c 3 c 4 c 5 c 6 c 7 d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 write the transmitted data (a) read the received data ( d ) a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * d b c a read the received data (c) write the transmitted data (b)
tmpm380/m382 tmpm380/m382 - 1 / 25 - 16 remote control signal preprocessor (rmc) 16.1 basic operation remote control signal preprocessor (hereafter referr ed to as rmc) receives a remote control signal of which carrier is removed. 16.1.1 reception of remote control signal ? sampled by 32khz clock ? noise canceller ? leader detection ? batch reception up to 72bit of data
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 2 / 25 - 16.2 registers 16.2.1 register map addresses and names of rmc control registers are shown below. register address remote control enable register rmcen 0x4004_0400 remote control receive enable register rmcren 0x4004_0404 remote control receive data buffer register 1 rmcrbuf1 0x4004_0408 remote control receive data buffer register 2 rmcrbuf2 0x4004_040c remote control receive data buffer register 3 rmcrbuf3 0x4004_0410 remote control receive contro l register 1 rmcrcr1 0x4004_0414 remote control receive contro l register 2 rmcrcr2 0x4004_0418 remote control receive contro l register 3 rmcrcr3 0x4004_041c remote control receive contro l register 4 rmcrcr4 0x4004_0420 remote control receive status register rmcrstat 0x4004_0424 remote control receive end bit number register1 rmcend1 0x4004_0428 remote control receive end bit number register2 rmcend2 0x4004_042c remote control receive end bit number register3 rmcend3 0x4004_0430 remote control source clock sele ction register rmcfssel 0x4004_0434
tmpm380/m382 tmpm380/m382 - 3 / 25 - 16.2.2 remote control enable register [rmcen] 7 6 5 4 3 2 1 0 bit symbol D D rmcen read/write r r/w r/w after reset 0 0 0 function ?0? is read. write as ?1?. rmc operation 0: disable 1: enable : controls rmc operation. to allow rmc to function, enable the rmcen bit first. if the operation is disabled, all the clocks for rmc except for the enable register are stopped, and it can reduce power consumption. if rmc is enabled and then disabled, the se ttings in each register remain intact. 16.2.3 remote control receive enable register [rmcren] 7 6 5 4 3 2 1 0 bit symbol D rmcren read/write r r/w after reset 0 0 function ?0? is read. receptio n 0: disable 1: enable : controls reception of rmc. setting this bit to ?1? enables reception. (note) enable the bit after setting the rmcxrcr1, rmcxrcr2 and rmcxrcr3.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 4 / 25 - 16.2.4 remote control receive data buffer register 1 [rmcrbuf1] 31 30 29 28 27 26 25 24 bit symbol rmcrbuf 31 rmcrbuf 30 rmcrbuf 29 rmcrbuf 28 rmcrbuf 27 rmcrbuf 26 rmcrbuf 25 rmcrbuf 24 read/write r after reset 0 function received data 23 22 21 20 19 18 17 16 bit symbol rmcrbuf 23 rmcrbuf 22 rmcrbuf 21 rmcrbuf 20 rmcrbuf 19 rmcrbuf 18 rmcrbuf 17 rmcrbuf 16 read/write r after reset 0 function received data 15 14 13 12 11 10 9 8 bit symbol rmcrbuf 15 rmcrbuf 14 rmcrbuf 13 rmcrbuf 12 rmcrbuf 11 rmcrbuf 10 rmcrbuf 9 rmcrbuf 8 read/write r after reset 0 function received data 7 6 5 4 3 2 1 0 bit symbol rmcrbuf 7 rmcrbuf 6 rmcrbuf 5 rmcrbuf 4 rmcrbuf 3 rmcrbuf 2 rmcrbuf 1 rmcrbuf 0 read/write r after reset 0 function received data : reads 4 bytes of received data.
tmpm380/m382 tmpm380/m382 - 5 / 25 - 16.2.5 remote control receive data buffer register 2 [rmcrbuf2] 31 30 29 28 27 26 25 24 bit symbol rmcrbuf 63 rmcrbuf 62 rmcrbuf 61 rmcrbuf 60 rmcrbuf 59 rmcrbuf 58 rmcrbuf 57 rmcrbuf 56 read/write r after reset 0 function received data 23 22 21 20 19 18 17 16 bit symbol rmcrbuf 55 rmcrbuf 54 rmcrbuf 53 rmcrbuf 52 rmcrbuf 51 rmcrbuf 50 rmcrbuf 49 rmcrbuf 48 read/write r after reset 0 function received data 15 14 13 12 11 10 9 8 bit symbol rmcrbuf 47 rmcrbuf 46 rmcrbuf 45 rmcrbuf 44 rmcrbuf 43 rmcrbuf 42 rmcrbuf 41 rmcrbuf 40 read/write r after reset 0 function received data 7 6 5 4 3 2 1 0 bit symbol rmcrbuf 39 rmcrbuf 38 rmcrbuf 37 rmcrbuf 36 rmcrbuf 35 rmcrbuf 34 rmcrbuf 33 rmcrbuf 32 read/write r after reset 0 function received data : reads 4 bytes of received data. 16.2.6 remote control receive data buffer register 3 [rmcrbuf3] 7 6 5 4 3 2 1 0 bit symbol rmcrbuf 71 rmcrbuf 70 rmcrbuf 69 rmcrbuf 68 rmcrbuf 67 rmcrbuf 66 rmcrbuf 65 rmcrbuf 64 read/write r after reset 0 function received data : reads a byte of received data. (note 1) received data is stored from rm crbuf1 to rmcrbuf3 in sequence. (note 2) the first received bit is stored in the ms b. the last received bit is stored in the lsb (bit 0). if the remote control signal is received in the lsb first algorithm, the received data is stored in reverse sequence.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 6 / 25 - 16.2.7 remote control receive control register 1 [rmcrcr1] 31 30 29 28 27 26 25 24 bit symbol rmclc max7 rmclc max6 rmclc max5 rmclc max4 rmclc max3 rmclc max2 rmclc max1 rmclc max0 read/write r/w after reset 0 function maximum cycle of leader det ection: rmclcmax4/fs[s] 23 22 21 20 19 18 17 16 bit symbol rmclc min7 rmclc min6 rmclc min5 rmclc min4 rmclc min3 rmclc min2 rmclc min1 rmclc min0 read/write r/w after reset 0 function minimum cycle of leader detection: rmclcmin4/fs[s] 15 14 13 12 11 10 9 8 bit symbol rmcll max7 rmcll max6 rmcll max5 rmcll max4 rmcll max3 rmcll max2 rmcll max1 rmcll max0 read/write r/w after reset 0 function maximum low width of leader detection: rmcllmax4/fs[s] 7 6 5 4 3 2 1 0 bit symbol rmcll min7 rmcll min6 rmcll min5 rmcll min4 rmcll min3 rmcll min2 rmcll min1 rmcll min0 read/write r/w after reset 0 function minimum low width of leader detection: rmcllmin4/fs[s] : specifies a maximum cycle of leader detection. calculating formula of the maximum cycle: rmclcmax4/fs[s]. rmc detects the first cycle as a leader if it is within the maximum cycle. : specifies a minimum cycle of leader detection. calculating formula of the minimum cycle: rmclcmin4/fs[s]. rmc detects the first cycle as a leader if it exceeds the minimum cycle. : specifies a maximum low width of leader detection. calculating formula of the maximum low width: rmcllmax4/fs[s] rmc detects the first cycle as a leader if its low width is within the maximum low width. : specifies a minimum low width of leader detection. calculating formula of the minimum low width: rmcllmin4/fs[s] rmc detects the first cycle as a leader if its low width exceeds the minimum low width. if rmcrcr2 = 1, a value less than the specified is determined as data.
tmpm380/m382 tmpm380/m382 - 7 / 25 - (note) when you configure the register, y ou must follow the rule shown below. leader rules low width + high width > > > only with high width > = 0y00000000 = don?t care no leader = 0y00000000 = don?t care = don?t care = don?t care
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 8 / 25 - 16.2.8 remote control receive control register 2 [rmcrcr2] 31 30 29 28 27 26 25 24 bit symbol rmclien rmcedie n D D D D rmcld rmcphm read/write r/w r/w r r/w r/w after reset 0 0 0 0 0 function leader detection interrupt 0: not generated : generated remote control input falling edge interrupt 0: not generated : generated ?0? is read. receiving remote control signal with or without leader 0: disable 1: enable receive a remote control signal in phase method? 0: no (receive in cycle method) 1:yes 23 22 21 20 19 18 17 16 bit symbol D D D D D D D D read/write r after reset 0 function ?0? is read. 15 14 13 12 11 10 9 8 bit symbol rmcll7 rmcll6 rmcll5 rmcll4 rmcll3 rmcll2 rmcll1 rmcll0 read/write r/w after reset 1 function excess low width that triggers recept ion completion and interrupt generation 0y00000000~0y11111110:rmcll1/fs[s] 0y11111111:not to use as the trigger 7 6 5 4 3 2 1 0 bit symbol rmcdma x7 rmcdma x6 rmcdma x5 rmcdma x4 rmcdma x3 rmcdma x2 rmcdma x1 rmcdma x0 read/write r/w after reset 1 function maximum data bit cycle that triggers re ception completion and interrupt generation 0y00000000~0y11111110:rmcdmax1/fs[s] 0y11111111: not to use as the trigger : enables to generate a leader detection interrupt by detecting a leader. : enables to generate a remote control input falling edge interrupt. : enables rmc to receive signals with or without a leader. : specifies data reception mode of a phase method. if you use the phase method of which signal cycle is fixed, set ?1?. : specifies an excess low width. if an excess low width is det ected, reception is completed and an interrupt is generated. the low width is not detected if = 0y11111111. calculating formula of an excess low width: rmcllx1/fs[s]. : specifies a threshold for detecting a maximum data bit cycle. it is detected when a data bit cycle exceeds the threshold. it is not detected when = 0y11111111. calculating formula of the threshold: rmcdmax x 1/fs[s].
tmpm380/m382 tmpm380/m382 - 9 / 25 - 16.2.9 remote control receive control register 3 [rmcrcr3] 15 14 13 12 11 10 9 8 bit symbol D rmcdat h6 rmcdat h5 rmcdat h4 rmcdat h3 rmcdat h2 rmcdat h1 rmcdat h0 read/write r r/w after reset 0 0 function ?0? is read. larger threshold to determine a signal pattern in a phase method rmcdath1/fs[s] 7 6 5 4 3 2 1 0 bit symbol D rmcdat l6 rmcdat l5 rmcdat l4 rmcdat l3 rmcdat l2 rmcdat l1 rmcdat l0 read/write r r/w after reset 0 0 function ?0? is read. threshold to determine 0 or 1 smaller threshold to determine a signal pattern in a phase method rmcdatl1/fs[s] : specifies a larger threshold (withi n a range of 1.5t and 2t) to determine a pattern of remote control signal in a phase me thod. if the measured cycle exceeds the threshold, the bit is determined as ?10?. if not, the bit is determined as ?01?. calculating formula of the threshold: rmcdathx1/fs[s]. : specifies two kinds of thresholds: a threshold to determine whether a data bit is 0 or 1; a smaller threshold (within a range of 1t and 1.5t) to determine a pattern of remote control signal in a phase method. as for the determination of data bit, if the measured cycle exceeds the threshold, the bit is determined as ?1?. if not, the bi t is determined as ?0?. calculating formula of the threshold: rmcdatl1/fs[s]. as for the determination of a remote contro l signal pattern in a phase method, if the measured cycle exceeds the th reshold, the bit is determined as ?01?. if not, the bit is determined as ?00?. calculating formula of the threshold to determine 0 or 1: rmcdatlx1/fs[s]. (note) if the bit of the remote control receive control register 2 is ?0?, are not enabled. the bits are enabled when is ?1?.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 10 / 25 - 16.2.10 remote control receive control register 4 [rmcrcr4] 7 6 5 4 3 2 1 0 bit symbol rmcpo D D D rmcnc 3 rmcnc 2 rmcnc 1 rmcnc 0 read/write r/w r r/w after reset 0 0 0 function remote control input signal 0: not reversed 1: reversed ?0? is read. noise cancellation time 0000: no cancellation 0001~1111:rmcnc1/fs[s] : specifies whether a remote cont rol input signal is reversed or not. : specifies time noises are cancelled by a noise canceller. if = ?0000?, noises are not cancelled. calculating form ula of noise cancellation time: rmcnc x 1/fs[s].
tmpm380/m382 tmpm380/m382 - 11 / 25 - 16.2.11 remote control receive status register [rmcrstat] 15 14 13 12 11 10 9 8 bit symbol rmcrlif rmcloif rmcdmax if rmcedif D D D D read/write r r r r r after reset 0 0 0 0 0 leader detection is interrupt factor? 0: no 1: yes low width detection is interrupt factor? 0: no 1: yes maximum data bit cycle detection is interrupt factor? 0: no 1: yes remote control input falling edge interrupt is interrupt factor? 0: no 1: yes ?0? is read. 7 6 5 4 3 2 1 0 bit symbol rmcrldr rmcrnu m6 rmcrnu m5 rmcrnu m4 rmcrnu m3 rmcrnu m2 rmcrnu m1 rmcrnu m0 read/write r r after reset 0 0 function leader detection 0: no 1: yes the number of received data bit 0y0000000:no data bit (only with leader) 0y0000001~0y1001000:1~72bit 0y1001001~0y1111111:73bit and more : indicates that leader detection is the interrupt factor. : indicates that low width detection is the interrupt factor. : indicates that maximum data bi t cycle detection is the interrupt factor. : indicates that a remote control i nput falling edge interrupt is the interrupt factor. : detects a leader of a received remote control signal : indicates the number of bits re ceived as remote control signal data. the number cannot be monitored during reception. on completion of reception, the number is stored. (note 1) this register is updated every time an interrupt is generated. writing to this register is ignored. (note 2) rmc keeps receiving 73 bit or more data unless reception is completed by detecting the maximum data bit cycle or the excess low width. if so, the received data in the data buffer may not be correct.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 12 / 25 - 16.2.12 remote control receive end bit number register 1 [rmcend1] 7 6 5 4 3 2 1 0 bit symbol D rmcend1 read/write r r/w after reset 0 0 function ?0? is read. specifies that the number of receive data bit 0000000: no specifically the receive data bit 0000001 to 1001000: 1bit to 72bit 1001001 to 1111111: don?t set the value : specifies that the number of receive data bit 16.2.13 remote control receive end bit number register 2 [rmcend2] 7 6 5 4 3 2 1 0 bit symbol D rmcend2 read/write r r/w after reset 0 0 function ?0? is read. specifies that the number of receive data bit 0000000: no specifically the receive data bit 0000001 to 1001000: 1bit to 72bit 1001001 to 1111111: don?t set the value : specifies that the number of receive data bit 16.2.14 remote control receive end bit number register 3 [rmcend3] 7 6 5 4 3 2 1 0 bit symbol D rmcend3 read/write r r/w after reset 0 0 function ?0? is read. specifies that the number of receive data bit 0000000: no specifically the receive data bit 0000001 to 1001000: 1bit to 72bit 1001001 to 1111111: don?t set the value : specifies that the number of receive data bit (note 1) (note 2) as specified to rmcend[3:1], it is able to set three kinds of the receive data bit. to use the rmcend[3:1] is in combination with the maximum data bit cycle.
tmpm380/m382 tmpm380/m382 - 13 / 25 - 16.2.15 remote control source clock se lection regi ster [rmcfssel] 7 6 5 4 3 2 1 0 bit symbol D rmcclk read/write r r/w after reset 0 0 function ?0? is read. rmc sampling clock 0 low frequency clock (32khz) 1 tb1out : specifies that sampling clock of rmc function for the sampling of rmc function ,it is able to set the low frequency clock(32khz) or timer output tb1out . the setting range of timer output by tb1out is from 30khz to 34khz. note to change the sampling clock by rmcfssel, at first stopping rmc operation by rmcen , after resetting enable operation , set the rmcfssel before the other rmc registers.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 14 / 25 - 16.3 operation description 16.3.1 reception of remote control signal 16.3.1.1 sampling clock a remote con trol signal is sampled by low-speed clock (fs). 16.3.1.2 basic operation rmc st arts to receive a data bit if a leader is detected while rmc is waiting for a leader. based on a falling edge cycle, the data bit is determined as 0 or 1. by detecting a leader while rmc is waiting for a leader, a leader detection interrupt is generated, and the data bit reception starts. the data bit is determined as 0 or 1 based on a falling edge cycle. rmc is capable of receiving data up to 72bit. reception is completed by detecting either a maxi mum data bit cycle or the excess low width. on completion of reception, rmc is waiting for the next leader, and the remote control receive data buffer registers and the remote contro l receive status register are updated. detecting leader capable of receiving data up to 72bits maximum data bit cycle interrupt specified period of a maximum data bit c y cle waiting for leader waiting for leader data reception completed by detecting the max data bit cycle
tmpm380/m382 tmpm380/m382 - 15 / 25 - 16.3.1.3 preparation configure reception operation of a remote contro l signal with the remote control signal receive control registers (rmcrcr1, rmcrcr 2 and rmcrcr3) before reception. (1) settings of noise cancelling time config ure n oise cancelling time wi th the rmcrcr4 bit. rmc monitors a remote control signal in each rising edge of a sampling clock. if ?1? is monitored, rmc recognizes that the signal was changed to ?0? after monitoring cycles of ?0?s specified in rmcnc. if ?0? is monitored, rmc recognizes that the signal was changed to ?1? after monitoring cycles of ?1?s specified in rmcnc. the following figure shows how rmc operates according to the noise cancel setting of rmcnc [3:0] = 0011 (3 cycles). subsequent to noise cancel lation, the signal is changed from ?1? to ?0? upon monitoring 3 cycles of ?0? s, and the signal is changed from ?0? to ?1? upon monitoring 3 cycles of ?1? s. sampling clock rmc pin after noise cancellation rmcnc [3:0] = 0011 (3 cycles) noise
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 16 / 25 - (2) settings of detecting leader t o detect a leader, configure cycle and low width of the leader with the rmcrcr1 bits. when you configure the register, you must follow the rule shown below. leader rules low width + high width > > > only with high width > = 0y00000000 = don?t care no leader = 0y00000000 = don?t care = don?t care = don?t care the following shows a leader waveform and the rmcrcr1 register settings. if you want to generate an interrupt when detecting a leader, configure the rmcrcr2 bit. a remote control signal without a leader cannot generate a leader detection interrupt. minimum low width: waiting for leader maximum low width: minimum cycle: maximum cycle: low width c y cle leader detection interrupt
tmpm380/m382 tmpm380/m382 - 17 / 25 - (3) settings of data bit determination based o n a falling edg e cycle, the data bit is determined as 0 or 1. configure a threshold of the determination with the rmcrcr3 bit. if the cycle exceeds the threshold, the bit is determined as ?1?. if not, the bit is determined as ?0?. by setting ?1? to the rmcrcr2 bit, a remote control signal input falling edge interrupt can be generated in each falling edge of the data bit. using this interrupt together with a 16-bit timer enables the determination to be done by software. the following shows how the data bit is determined as ?0? or ?1?. as for data bit determination of a remote control signal in a phase method, see 16.3.1.10 ?receiving a remote co ntrol signal in a phase method?. data bit waveform example: threshold of 0/1 determination is set to 2.5t with the bit. t t t t t t t t t threshold of 0/1 determination determination result ?0? ?0? ?1? t remote control input falling edge interrupt
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 18 / 25 - (4) settings of reception completion t o complete data reception, settings of detecting the maximum data bit cycle and excess low width are required. if multiple factors are specified, re ception is completed by the factor detected first. make sure to configure the reception completion settings. 1) completed by a maximum data bit cycle to complete reception by detecting a maximum dat a bit cycle, you need to configure the rmcrcr2 bits. if the falling edge of the data bi t cycle isn?t monitored after time specified as threshold in the bits, a maximum data bit cycle is detected. the detection completes reception and generates an interrupt. to complete reception by setting t he number of receive data is set a rmcend 1 to 3 register of each . in this case when the number of set reception bi t agreed with the number of bit which i received at the time of the outbreak of max on of three rmcend1 - r egisters, , in data bit period, it occurs by an max interrupt in data bit period. to set the number of receive data can be set in the three rmcend1> register. when it can receive the maximum data bit , the number of bit is not match the setting value in register., it wait for leader reception. 2) completed by excess low width to complete reception by detecting the low width, you need to configure the rmcrcr2 bits. after the falling edge of the data bit is detected, if the signal stays low longer than specified, excess low width is detected. the detection completes reception and generates an interrupt.
tmpm380/m382 tmpm380/m382 - 19 / 25 - 16.3.1.4 enabling reception by enabling the rm cren bit after configuring the rmcrcr1, rmcrcr2, rmcrcr3 and rmcrcr4 registers, rmc is ready for reception. detecting a leader initiates reception. (note) changing the configurations of the rmcrcr1, rmcrcr2, rmcrcr3 and rmcrcr4 registers during reception may harm their proper operation. be careful if you change them during reception. 16.3.1.5 reception dete cting a leade r sets the rmcrstat bit. simultaneously, a leader detection interrupt is generated if the rm crcr2 bit is set. when the interrupt is generated, the rmcrstat bit is set. next to the leader detection, each data bit is de termined as 0 or 1. the results are stored in the rmcrbuf1, rmcrbuf 2 and rmcrbuf 3 registers up to 72bits. by setting ?1? to the rmcrcr2 bit, a remote control signal input falling edge interrupt can be generated in each falling edge of the data bit. when the interrupt is generated, the rmcrstat bit is set. detecting the maximum data bit cycle or the ex cess low width completes reception and generates an interrupt. only when the received number of bit un til detecting data bit cycle max is corresponding, it becomes reception end/interruption gener ation when , , and of the rmcend1 to 3 register are set. to check the status of rmc after reception is co mpleted, read the remote control receive status register. on completion of reception, rmc is waiting for the next leader. by setting rmc to receive a signal without a leader , rmc recognizes the received is data and starts reception without detecting a leader. if the next data reception is completed before re ading the preceding received data, the preceding data is over-written by the next one.
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 20 / 25 - 16.3.1.6 reception completion 1) complete d by a maximum data bit cycle detecting a maximum data bit cycle completes reception and generates an interrupt. after the interrupt is generated, the rmcrstat bit is set to ?1?. 2) completed by excess low width detecting excess low width completes reception and generates an interrupt. after the interrupt is generated, the rmcrstat bit is set to ?1?. threshold: if the falling edge of the data bit cycle isn?t monitored after time specified as threshold, a maximum data bit cycle is detected. the detection completes reception and generates an interrupt. maximum data bit cycle interrupt threshold: < rmcll7:0> excess low width is detected when signal stay low longer than specified. excess low width detection interrupt
tmpm380/m382 tmpm380/m382 - 21 / 25 - rmc keeps receiving 73 bit or more data unless reception is completed by detecting the maximum data bit cycle or the excess low width. if so, the received data in the data buffer may not be correct. to check the status of rmc after reception is co mpleted, read the remote control receive status register. the status of rmc that each bit type indicates is shown below. rmc status 0 0000001~1001000 receiving remote control signal without a leader (data bits: 1~72bit) 0 1001001~1111111 receiving remote control signal without a leader (data bits: 73bit and more) 1 0000000 only with a leader 1 0000001~1001000 receiving remote control signal with a leader (data bits: 1~72bit) 1 1001001~1111111 receiving remote control signal without a leader (data bits: 73bit and more)
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 22 / 25 - 16.3.1.7 stopping reception rmc sto ps reception by clearing the rmcren bit to ?0? (reception disabled). clearing this bit during reception stops reception immediately and the received data is discarded. 16.3.1.8 receiving remote control signal without leader setting rmcrcr2 enables rmc to receive signals with or without a leader. by setting rmcrcr2 , rmc starts receiving data if it recognizes a signal of which low width is shorter than a maximum low width of leader detection specified in the rmcrcr1 bits. rmc keeps receiving data until the final data bit is received. if rmcrcr2 is enabled, the same settings of error detection, reception completion and data bit determination of 0 or 1 are applied regardle ss of whether a signal has a leader or not. thus receivable remote control signals are limited. waiting for leader leader waveform minimum low width maximum data bit c y cle < rmcdmax7:0> rmcrcr2 register =1 maximum data bit cycle is detected if a signal stays low shorter than specified and longer than a maximum data bit cycle. a waveform of which low width is shorter than specified is determined as the beginning of data. rmc starts data reception.
tmpm380/m382 tmpm380/m382 - 23 / 25 - 16.3.1.9 a leader only with low width the figure shown bel ow illu strates a remote control signal that starts with a leader of which waveform only has low width. this signal starts with a leader that only has low width and a data bit cycle starts from the rising edge. to enable the signal , it must be sent after being reversed by setting the rmcrcr4 bit to ?1?. this is because rmc is configured to detect a data bit cycle from the falling edge. a leader is detected by the low width. when you configure the rm crcr1 register, you must follow the rule shown below. = 0y00000000 > if the rules are applied, rmc does not care about the value of . to determine the data bit as 0 or 1, configure a threshold of the determination with the rmcrcr3 bit. configure a maximum data bit cycle with the bits of the remote control receive control register 2. to complete reception by detecting the maximu m data bit cycle, you need to configure the rmcrcr2 bits. to complete reception by detecting the low width, you need to configure the rmcrcr2 bits. detecting the maximum data bit cycle or the excess low width completes reception and generates an interrupt. rmc waits for the next leader. waiting for a leader waiting for a leader low width detection interru p t reversed remote control signal waveform leader detecting maximum data bit cycle completes reception. leader detection interrupt low period final bit remote control signal waveform (input from pin)
16 remote control signal preprocessor (rmc) tmpm380/m382 tmpm380/m382 - 24 / 25 - 16.3.1.10 receiving a remote control signal in a phase method rmc is capa ble of receiving a remote control signal in a phase method of which signal cycle is fixed. a signal in the phase method has three waveform patterns (see the figure shown below). by setting two thresholds a remote control signal pattern is determined. rmc converts the signal into data ?0? or ?1?. on completion of reception, received data ?0? and ?1? are stored in the rmcrbuf1, rmcrbuf 2 and rmcrbuf3. by setting rmcrcr2=?1?, rmc enables to receive a remote control signal in the phase method. each threshold can be configured with the rmcrcr3 bits and bits. two thresholds are used to distinguish three waveform patterns. on condition that a cycle between two falling edges is ?t?, three patterns show cycles of 1t, 1.5t and 2t. details of the two thresholds are shown below. to determine a remote control signal in the phas e method, three patterns of data waveform and preceding data are required. in addition, the signal needs to start from data ?1?. determined by threshold register bits to set threshold 1 pattern 1 & pattern 2 1t~1.5t rmcrcr3 register threshold 2 pattern 2 & pattern 3 1.5t~2t rmcrcr3 register waveform pattern in phase method pattern 1 pattern 2 pattern 3 cycle t remote control signal data in phase method data ?1? data ?0? a pulse shape in a cycle indicates whether it is data ?0? or data ?1?.
tmpm380/m382 tmpm380/m382 - 25 / 25 - remote control signal the first two bits of data need to be ?11?. remote control signal in phase method
tmpm380/m382 tmpm380/m382 - 1 / 6 - 17 watchdog timer (wdt) the watchdog timer (wdt) is for detecting malfunct ions (runaways) of the cpu caused by noises or other disturbances and remedying them to return the cpu to normal operation. if the timer detects a runaway, it generates a non-maskable interrupt or an internal reset to notify the cpu. the watchdog timer starts immediately after reset release. note : intwdt interrupt is a factor of the non-maskable interrpts(nmi). 17.1 configuration fig 17-1 show s the bl ock diagram of the watchdog timer fig 17-1 block diagram of the watchdog timer binary counter wdmod internal reset wdmod ? wdmod watchdog timer interrupt intwdt selector reset pin reset watch dog timer control register wdcr internal reset internal data bus write 0x4e f sys write 0xb1 q rs 2 15 /fsys 2 17 /fsys 2 19 /fsys 2 21 /fsys 2 23 /fsys 2 25 /fsys
17 watchdog timer (wdt) tmpm380/m382 tmpm380/m382 - 2 / 6 - 17.2 outline the watchdog timer consists of the binary counters that are arranged in 25 stages and work using the f sys system clock as an input cl ock. the outputs produced by these binary counters are 2 15 , 2 17 , 2 19 , 2 21 , 2 23 are 2 25 . by selecting one of these outputs with wdmod , intwdt can be generated when an overflow occurs, as shown in fig 17-2 . 17.2.1 intwdt (wdmod=0) when an overflow occurs, the watchdog timer generates intwdt to the cpu. fig 17-2 normal mode 17.2.2 reset mode(wdmod=1) when an overflow occurs, resetting the chip itself is an option to choose. if the chip is reset, a reset is affected for a 32-state time, as shown in fig 17-3 . if this reset is af fected, the clock f sys that the clock gear generates by dividing the clock f c of the high-speed oscillator by 1 is used as an input clock f sys . fig 17-3 reset mode intwdt wdt clear wdt counter 0 write of a clear code n overflow overflow wdt counter n intwdt 32-state (3.2 s @ fosc = 10 mhz, f c = fsys = 10 mhz,) internal reset
tmpm380/m382 tmpm380/m382 - 3 / 6 - 17.3 control registers the watchdog timer (wdt) is controlled by two control registers wdmod and wdcr. 17.3.1 watchdog timer mode register (wdmod) 1. enabling/disabling the watchdog timer when resetting, wdmod is initialized to "1" and the watchdog timer is enabled. to disable the watchdog timer, this bit must be se t to "0" and, at the same time, the disable code (0xb1) must be written to the wdcr register. this dual setting is intended to minimize the probability that the watchdog timer may inadver tently be disabled if a runaway occurs. to change the status of the watchdog timer from "disable" to "enable," set the bit to "1". 2. specifying the detection time of the watchdog timer this is a 3-bit register for specifying the intw dt time for runaway detection. when a reset is effected, this register is initialized to wdmod = "000." fig 17-4 shows the detection time of the watchd og time r. 3. enabling/disabling the watchdog timer in idle mode enabling/disabling the watchdog timer in idle mode is controlled by this bit. writing ?1? to this bit enables the watchdog timer and writing ?0? to this bit disables the watchdog timer in idle mode. (note) watchdog timer is stopped in stop mode. 4. watchdog timer out reset connection setting this bit to "1" enables the watch dog timer to be reset when a runaway is detected. since a reset initializes this bit to "1," a counter overflow causes a reset. 17.3.2 watchdog timer control register (wdcr) this is a register for disabling the watchdog timer function and controlling the clearing function of the binary counter. ? disabling control by writing the disable code (0xb1) to this wdcr register after setting wdmod to "0," the watchdog timer can be disabled. wdmod 0 ? ? ? ? ? ? ? clears wdte to "0." wdcr 1 0 1 1 0 0 0 1 writes the disable code (0xb1). ? enabling control set wdmod to "1".
17 watchdog timer (wdt) tmpm380/m382 tmpm380/m382 - 4 / 6 - ? watchdog timer clearing control writing the clear code (0x4e) to the wdcr register clears the binary counter and allows it to resume counting. wdcr 0 1 0 0 1 1 1 0 writes the clear code (0x4e) (note) writing the disable code (0xb1) clears the binary counter .
tmpm380/m382 tmpm380/m382 - 5 / 6 - watchdog timer mode register 7 6 5 4 3 2 1 0 bit symbol wdte wdtp2 wdtp1 wdtp0 i2wdt rescr read/write r/w r/w r r/w r/w after reset 1 0 0 0 0 1 0 function wdt control 0: disable 1: enable selects wdt detection time 000: 2 15 /f sys 001: 2 17 /f sys 010: 2 19 /f sys 011: 2 21 /f sys 100: 2 23 /f sys 101: 2 25 /f sys 110: setting prohibited 111: setting prohibited "0" is read. idle 0: stop 1: start wdt out control 0: generates intwdt 1: generates reset write "0." watchdog timer out control 0 generates intwdt 1 generates reset detection time of watchdog timer wdmod syscr1 clock gear value 000 001 010 011 100 101 000 (fc) 0.82 ms 3.28 ms 13.11 ms 52.43 ms 209.72 ms 838.86 ms 100 (fc/2) 1.63 ms 6.55 ms 26.21 ms 104.86 ms 419.43 ms 1.68 s 101 (fc/4) 3.28 ms 13.11 ms 52.43 ms 209.72 ms 838.86 ms 3.36 s 110 (fc/8) 6.55 ms 26.21 ms 104.86 ms 419.43 ms 1.68 s 6.71 s 111 (fc/16) 13.11 ms 52.43 ms 209.72 ms 838.86 ms 3.36 s 13.42 s 0 disable 1 enable watchdog timer control register 7 6 5 4 3 2 1 0 bit symbol wdcr read/write w after reset - function 0xb1 : wdt disable code 0x4e : wdt clear code 0xb1 wdt disable code 0x4e wdt clear code others - fig 17-4 watchdog timer registers detection time of watchdog timer @ fc = 40 mhz enable/disable control of the watchdog timer disable & clear of wdt wdcr (0x4004_0004) ? wdmod (0x4004_0000) ?
17 watchdog timer (wdt) tmpm380/m382 tmpm380/m382 - 6 / 6 - 17.4 operation the watchdog timer generates the intwdt or an internal reset after a lapse of the detection time specified by the wdmod register. before generating the intwdt or an internal reset, the binary counter for the watchdog timer must be cl eared to "0" using software (instruction). if the cpu malfunctions (runaways) due to noise or other disturbances and cannot execute the instruction to clear the binary counter, the binary counte r overflows and the non-maskable interrupt by the intwdt or an internal reset is generated. the cpu is able to recognize the occurrence of a malfunction (runaway) by identifying the non-maskable interrupt and to restore the faulty condition to normal by using a malfunction (runaway) countermeasure program. the watchdog timer begins operation immediately after a reset is cleared. in stop mode, the watchdog timer is reset and in an idle state. in idle mode, its operation depends on the wdmod setting. before putting it in idle mode, wdmod must be set to an appropriate setting, as required. example: 1. to clear the binary counter 7 6 5 4 3 2 1 0 wdcr 0 1 0 0 1 1 1 0 writes the clear code (0x4e) 2. to set the detection time of the watchdog timer to 2 17 /f sys. 7 6 5 4 3 2 1 0 wdmod 1 0 0 1 ? ? ? ? 3. to disable the watchdog timer. 7 6 5 4 3 2 1 0 wdmod 0 ? ? ? ? ? ? ? clears wdte to "0" wdcr 1 0 1 1 0 0 0 1 writes the disable code (0xb1) (note 1) the counter of the watchdog timer stops at the debug mode.
tmpm380/m382 tmpm380/m382 - 1 / 16 - 18 real time clock (rtc) 18.1 functions 1) clock (hour, minute and second) 2) calendar (month, week, date and leap year) 3) selectable 12 (am/ pm) and 24 hour display 4) time adjustment or 30 seconds (by software) 5) alarm (alarm output) 6) alarm interrupt 18.2 block diagram fig. 18-1 block diagram (note 1) western calendar year column: this product uses only the final two digits of the year. the year following 99 is 00 years. please take into account the first two digits when handling years in the western calendar. (note 2) leap year: a leap year is divisible by 4 excluding a year divisible by 100; the year divisible by 100 is not considered to be a leap year. any year divisible by 400 is a leap year. this product is considered the year divisible by 4 to be a leap year and does not take into account the above exceptions. it needs adjustments for the exceptions. 32 khz clock sec. counter comparator alarm register r/w control a ddress bus clock alarm selector alarm 16 hz clock 1 hz clock internal data bus address d0~d16 wr rd adjust ? intrtc
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 2 / 16 - 18.3 control registers reset operation initializes the following registers: z rtcpager,, z rtcrestr,,, other clock-related registers are not initialized by reset operation. before starting the rtc, set the time, month, day, day of the week, year and leap year in the relevant registers. caution is required in setting clock data, adjusti ng seconds or resetting the clock. refer to ? 18.5.3 entering the low powe r consumption mode?. table 18-1 page0 (clock function) register symbol address bit7 bit6 bit5 bit4 bi t3 bit2 bit1 bit0 function read/write rtcsecr 0x4004_0100 40 sec 20 sec 10 sec 8 sec 4 sec 2 sec 1 sec second column r/w rtcminr 0x4004_0101 40 min 20 min 10 min 8 mi n 4 min 2 min 1 min minute column r/w rtchourr 0x4004_0102 20 hours /pm/am 10 hours 8 hours 4 hours 2 hours 1 hour hour column r/w rtcdayr 0x4004_0104 w2 w1 w0 day of the week column r/w rtcdater 0x4004_0105 day 20 day 10 day 8 day 4 day 2 day 1 day column r/w rtcmonthr 0x4004_0106 oct. aug. apr. feb. jan. month column r/w rtcyearr 0x4004_0107 year 80 year 40 year 20 year 10 year 8 year 4 year 2 year 1 year column (lower two columns) r/w rtcpager 0x4004_0108 interrupt enable a djustment function clock enable alarm enable page setting page register w, r/w rtcrestr 0x4004_010c 1hz enable 16hz enable clock reset alarm reset always write ?0?. reset register w only (note) reading rtc secr, rtc minr, rtc hourr, rtc dayr, rtc monthr, rtc yearr of page0 captures the current state. table 18-2 page1 (alarm function) registers symbol address bit7 bit6 bit5 bit4 bi t3 bit2 bit1 bit0 function read/write rtcsecr 0x4004_0100 rtcminr 0x4004_0101 40 min 20 min 10 min 8 mi n 4 min 2 min 1 min minute column r/w rtchourr 0x4004_0102 20 hours /pm/am 10 hours 8 hours 4 hours 2 hours 1 hour hour column r/w rtcdayr 0x4004_0104 w2 w1 w0 day of the week column r/w rtcdater 0x4004_0105 day 20 day 10 day 8 day 4 day 2 day 1 day column r/w rtcmonthr 0x4004_0106 24/12 24-hours clock mode r/w rtcyearr 0x4004_0107 leap-year setting leap-year mode r/w rtcpager 0x4004_0108 interrupt enable adjustment function clock enable alarm enable page setting page register w,r/w rtcrestr 0x4004_010c 1hz enable 16hz enable clock reset alarm reset always write ?0?. reset register w only
tmpm380/m382 tmpm380/m382 - 3 / 16 - (note 1) reading rtc secr, rtc minr, rtc hourr, rtc dayr, rtc monthr, rtc yearr of page1 captures the current state. (note 2) rtc secr, rtc minr, rtc hourr, rtc dayr, rtc monthr, rtc yearr of page0 and yearr of page1 (for leap year) must be read twice and compare the data captured.
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 4 / 16 - 18.4 detailed description of control register the rtc is not initialized by system reset. all registers must be initialized at the beginning of the program. (1) second column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol D se6 se5 se4 se3 se2 se1 se0 rtcsecr read/write r r/w after reset 0 undefined function ?0? is read. 40 sec. column 20 sec. column 10 sec. column 8 sec. column 4 sec. column 2 sec. column 1 sec. column 0 0 0 0 0 0 0 0 sec 0 0 0 0 0 0 1 1 sec 0 0 0 0 0 1 0 2 sec 0 0 0 0 0 1 1 3 sec 0 0 0 0 1 0 0 4 sec 0 0 0 0 1 0 1 5 sec 0 0 0 0 1 1 0 6 sec 0 0 0 0 1 1 1 7 sec 0 0 0 1 0 0 0 8 sec 0 0 0 1 0 0 1 9 sec 0 0 1 0 0 0 0 10 sec : 0 0 1 1 0 0 1 19 sec 0 1 0 0 0 0 0 20 sec : 0 1 0 1 0 0 1 29 sec 0 1 1 0 0 0 0 30 sec : 0 1 1 1 0 0 1 39 sec 1 0 0 0 0 0 0 40 sec : 1 0 0 1 0 0 1 49 sec 1 0 1 0 0 0 0 50 sec : 1 0 1 1 0 0 1 59 sec note) the setting other than listed above is prohibited.
tmpm380/m382 tmpm380/m382 - 5 / 16 - (2) minute column register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol D mi6 mi5 mi4 mi3 mi2 mi1 mi0 rtcminr read/write r r/w after reset 0 undefined function ?0? is read 40 min. column 20 min. column 10 min. column 8 min. column 4 min. column 2 min. column 1 min. column 0 0 0 0 0 0 0 0 min 0 0 0 0 0 0 1 1 min 0 0 0 0 0 1 0 2 min 0 0 0 0 0 1 1 3 min 0 0 0 0 1 0 0 4 min 0 0 0 0 1 0 1 5 min 0 0 0 0 1 1 0 6 min 0 0 0 0 1 1 1 7 min 0 0 0 1 0 0 0 8 min 0 0 0 1 0 0 1 9 min 0 0 1 0 0 0 0 10 min : 0 0 1 1 0 0 1 19 min 0 1 0 0 0 0 0 20 min : 0 1 0 1 0 0 1 29 min 0 1 1 0 0 0 0 30 min : 0 1 1 1 0 0 1 39 min 1 0 0 0 0 0 0 40 min : 1 0 0 1 0 0 1 49 min 1 0 1 0 0 0 0 50 min : 1 0 1 1 0 0 1 59 min note) the setting other than listed above is prohibited.
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 6 / 16 - (3) hour column register (for page0/1) 1. 24-hour clock mode (rtcmonthr = ?1?) 7 6 5 4 3 2 1 0 bit symbol D ho5 ho4 ho3 ho2 ho1 ho0 rtchourr read/write r r/w after reset 0 undefined function ?0?is read. 20 hours column 10 hours column 8 hours column 4 hours column 2 hours column 1 hour column 0 0 0 0 0 0 0 o? clock 0 0 0 0 0 1 1 o? clock 0 0 0 0 1 0 2 o? clock : 0 0 1 0 0 0 8 o? clock 0 0 1 0 0 1 9 o? clock 0 1 0 0 0 0 10 o? clock : 0 1 1 0 0 1 19 o? clock 1 0 0 0 0 0 20 o? clock : 1 0 0 0 1 1 23 o? clock note) the setting other than listed above is prohibited. 2. 12-hour clock mode (rtcmonthr = ?0?) 7 6 5 4 3 2 1 0 bit symbol D ho5 ho4 ho3 ho2 ho1 ho0 rtchourr read/write r r/w after reset 0 undefined function ?0?is read. pm/am 10 hours column 8 hours column 4 hours column 2 hours column 1 hour column 0 0 0 0 0 0 0 o? clock (am) 0 0 0 0 0 1 1 o? clock 0 0 0 0 1 0 2 o? clock : 0 0 1 0 0 1 9 o? clock 0 1 0 0 0 0 10 o? clock 0 1 0 0 0 1 11 o? clock 1 0 0 0 0 0 0 o? clock (pm) 1 0 0 0 0 1 1 o? clock note) the setting other than listed above is prohibited.
tmpm380/m382 tmpm380/m382 - 7 / 16 - (4) day of the week column register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol D we2 we1 we0 rtcdayr read/write r r/w after reset 0 undefined function ?0? is read. w2 w1 w0 0 0 0 sunday 0 0 1 monday 0 1 0 tuesday 0 1 1 wednesday 1 0 0 thursday 1 0 1 friday 1 1 0 saturday note) the setting other than listed above is prohibited. (5) day column register (page0/1) 7 6 5 4 3 2 1 0 bit symbol D da5 da4 da3 da2 da1 da0 rtcdater read/write r r/w after reset 0 undefined function ?0? is read. day 20 day 10 day 8 day 4 day 2 day 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1st day 0 0 0 0 1 0 2nd day 0 0 0 0 1 1 3rd day 0 0 0 1 0 0 4th day : 0 0 1 0 0 1 9th day 0 1 0 0 0 0 10th day 0 1 0 0 0 1 11th day : 0 1 1 0 0 1 19th day 1 0 0 0 0 0 20th day : 1 0 1 0 0 1 29th day 1 1 0 0 0 0 30th day 1 1 0 0 0 1 31st day note 1) the setting other than listed above is prohibited. note 2) do not set for non-existent days (e.g.: 30th feb.)
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 8 / 16 - (6) month column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol D mo4 mo4 mo2 mo1 mo0 rtcmonthr read/write r r/w after reset 0 undefined function ?0? is read. 10 months 8 months 4 months 2 months 1 month 0 0 0 0 1 january 0 0 0 1 0 february 0 0 0 1 1 march 0 0 1 0 0 april 0 0 1 0 1 may 0 0 1 1 0 june 0 0 1 1 1 july 0 1 0 0 0 august 0 1 0 0 1 september 1 0 0 0 0 october 1 0 0 0 1 november 1 0 0 1 0 december note) the setting other than listed above is prohibited. (7) selection of 24-hour clock or 12-hour clock (for page1 only) 7 6 5 4 3 2 1 0 bit symbol D mo0 rtcmonthr read/write r r/w after reset 0 undefined function ?0? is read. 1: 24-hours 0: 12-hours note do not change the rtc monthr bit while the rtc is in operation.
tmpm380/m382 tmpm380/m382 - 9 / 16 - (8) year column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol ye7 ye6 ye5 ye4 ye3 ye2 ye1 ye0 rtcyearr read/write r/w after reset undefined function 80 years 40 years 20 years 10 years 8 years 4 years 2 years 1 year 0 0 0 0 0 0 0 0 00 year 0 0 0 0 0 0 0 1 01 year 0 0 0 0 0 0 1 0 02 years 0 0 0 0 0 0 1 1 03 years 0 0 0 0 0 1 0 0 04 years 0 0 0 0 0 1 0 1 05 years : 1 0 0 1 1 0 0 1 99 years note) the setting other than listed above is prohibited. (9) leap year register (for page1 only) 7 6 5 4 3 2 1 0 bit symbol D leap1 leap0 rtcyearr read/write r r/w after reset 0 undefined function ?0? is read. 00: leap year 01: one year after leap year 10: two years after leap year 11: three years after leap year 0 0 current year is a leap-year. 0 1 current year is the year following a leap-year. 1 0 current year is two years after a leap year. 1 1 current year is three years after a leap year
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 10 / 16 - (10) page register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol intena D adjust enatmr enaalm D page rtcpager read/write r/w r r/w r/w r r/w after reset 0 0 0 undefined 0 0 a read-modify- write operation cannot be performed. function intrtc 0: disabled 1: enabled ?0? is read. [write] 0: don?t care 1:sets adjust request [read] 0:no adjust requested 1:adjust requested clock 0: disabled 1: enabled alarm 0: disabled 1: enabled ?0? is read. page selection (note) keep the setting order of , and as shown in the example below. ensure an interval of time between clock/alarm and interrupt. example: clock setting/alarm setting 7 6 5 4 3 2 1 0 rtcpager 0 0 0 0 1 1 0 0 enables clock and alarm rtcpager 1 0 0 0 1 1 0 0 enables interrupt by setting bit 7 to ?1?. 0 selects page0 page 1 selects page1 0 don?t care adjust 1 adjusts seconds. the request is sampled when the sec. counter counts up. if the time elapsed is between 0 and 29 seconds, the sec. counter is cleared to ?0?. if the time elapsed is between 30 and 59 seconds, the min. counter is carried and sec. counter is cleared to "0". reading this bit shows if adjust is requested or not.
tmpm380/m382 tmpm380/m382 - 11 / 16 - (11) reset register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol dis1hz dis16hz rsttmr rstalm ? dis2hz dis4hz dis8hz rtcrestr read/write r/w r r/w after reset 1 1 0 0 0 1 1 1 a read-modify- write operation cannot be performed. function 1? hz 0: enabled 1: disabled 16? hz 0: enabled 1: disabled [write] 0:don?t care 1:clock reset [read] 0:no reset request -ed 1:reset request -ed 0:don?t care 1:alarm reset ?0? is read. 2? hz 0: enabled 1: disabled 4? hz 0: enabled 1: disabled 8? hz 0: enabled 1: disabled 0 unused rstalm 1 initializes alarm registers (minute column, hour column, day column and day of the week column) as follows. minute: 00, hour: 00, day: 01, day of the week: sunday 0 unused rsttmr 1 resets sec counter. reading th is bit shows if reset is requested or not. the request is sampled using low-speed clock. rtcpager interrupt source signal 1 1 1 1 1 1 alarm 0 1 1 1 1 0 1hz 1 0 1 1 1 0 2hz 1 1 0 1 1 0 4hz 1 1 1 0 1 0 8hz 1 1 1 1 0 0 16hz others outputs ?0?.
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 12 / 16 - 18.5 operational description the rtc incorporates a sec. counter that gene rates a 1hz signal from a 32.768 khz signal. the sec. counter operation must be taken into account when using the rtc. note : after reset, low-speed oscillator stops oscillation ? and xt1/xt2 pins are initialized to port-p (pp0,pp1). please re-set up to rtc registers. 18.5.1 reading clock data 1. using 1hz interrupt the 1hz interrupt is generated being sync hronized with counting up of the sec. counter. data can be read correctly if reading data after 1hz interrupt occurred. 2. using pair reading there is a possibility that the clock data may be read incorrec tly if the internal counter operates carry during reading. to ensure correct data reading, read the clock data twice as shown below. a pair of data read successively needs to match. fig. 18-2 flowchart of the clock data reading start end rtcpager = ?0?, then select page0 clock data reading (1st) clock data reading (2nd) 1 st data = 2 nd data no yes
tmpm380/m382 tmpm380/m382 - 13 / 16 - 18.5.2 writing clock data a carry during writing ruins correct data writing. the following procedure ensures the correct data writing. 1. using 1hz interrupt the 1hz interrupt is generated being sync hronized with counting up of the sec. counter. if data is written in the time between 1hz interrupt and subsequent one second count, it completes correctly. 2. resetting counter write data after resetting the sec. counter. the 1hz-interrupt is generated one second after enabling the interrupt subsequent to counter reset. the time must be set within one second after the interrupt. fig. 18-3 flowchart of the clock data writing start rtcpager = ?0? then select page0 rtcrestr = ?1? then reset counter rtcrestr = ?0? then enable 1hz interrupt first interrupt (after 1s) no yes end time setting
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 14 / 16 - 3. disabling the clock writing ?0? to rtcpager disables clock operation including a carry. stop the clock after the 1hz-interrupt. the sec. counter keeps counting. set the clock again and enable the clock within one second before next 1hz-interrupt. fig. 18-4 flowchart of the disabling clock 18.5.3 entering the low power consumption mode to enter sleep mode, in which the system clock stops, after changing clock data, adjusting seconds or resetting the clock, be sure to observe one of the following procedures: 1. after changing the clock setting regist ers, setting the rtcpager bit or setting the rtcrestr bit, wait for one second for an interrupt to be generated. 2. after changing the clock setting regist ers, setting the rtcpager bit or setting the rtcrestr bit, read the corresponding clock register values, or to make sure that the setting you have made is reflected. start end disabling clock writing the clock data enabling the clock
tmpm380/m382 tmpm380/m382 - 15 / 16 - 18.6 alarm function by writing ?1? to rtcpager, the alarm function of the page1 registers is enabled. one of the following three signals is output to the a larm pin. (1) ?0? pulse (when the alarm register corresponds with the clock) (2) 1hz cycle ?0? pulse (3) 16hz cycle ?0? pulse in any cases shown above, the intrtc outputs on e cycle pulse of low-speed clock. it outputs the intrtc interrupt request simultaneously. the intrtc interrupt signal is falling edge triggered. specify the falling edge as the active state in the cg interrupt mode control register. (1) ?0? pulse (when the alarm register corresponds with the clock) ?0? pulse is output to the a larm pin when the values of the page0 clock register and the page1 alarm register correspond. the intr tc interrupt is generated and the alarm is triggered. the alarm settings initialize the alarm with alarm prohibited. write ?1? to rtcrestr. it makes the alarm setting to be 00 minute, 00 hour, 01 day and sunday. setting alarm for min., hour, date and day is done by writing data to the relevant page1 register. enable the alarm with the rtcpager bit. enable the interrupt with the rtcpager bit. the following is an example program for outputting an alarm from the a larm pin at noon (12:00p.m.) on monday 5 th . 7 6 5 4 3 2 1 0 rtcpager 0 0 0 0 1 0 0 1 disables alarm, sets page1 rtcrestr 1 1 0 1 0 0 0 0 initializes alarm rtcdayr 0 0 0 0 0 0 0 1 monday rtcdater 0 0 0 0 0 1 0 1 5th day rtchourr 0 0 0 1 0 0 1 0 sets 12 o?clock rtcminr 0 0 0 0 0 0 0 0 sets 00 min. rtcpager 0 0 0 0 1 1 0 0 enables alarm rtcpager 1 0 0 0 1 1 0 0 enables interrupt the above alarm works in synchronization with the low-speed clock. when the cpu is operating at high frequency oscillation, a maxi mum of one clock delay at 32 khz (about 30s) may occur for the time register setting to become valid. (note) to make the alarm work repeatedly (e.g. every wednesday at 12:00), ? next alarm must be set during the intrtc interrupt routine that is generated when the time set for the alarm matches the rtc count.
18 real time clock (rtc) tmpm380/m382 tmpm380/m382 - 16 / 16 - (2) 1hz cycle ?0? pulse the rtc outputs a "0" pulse cycle of low-speed 1hz clock to the a larm pin by setting rtcpager=1 after setti ng rtcpager= ?0?, rtcrestr= ?0? and = ?1?. it generates an intrtc interrupt simultaneously. (3) 16hz cycle ?0? pulse the rtc outputs a "0" pulse cycle of low-speed 16hz clock to the a larm pin by setting rtcpager=1 after setti ng rtcpager= ?0?, rtcrestr= ?1? and = ?0?. it generates an intrtc interrupt simultaneously.
tmpm380/382 tmpm380/382 - 1 / 12 - 19 ocsillation frequency detector (ofd) 19.1 brief overview the oscillation frequency detector circuit generates a reset for micro if the external oscillation of high frequency for cpu clock exceeds t he detection frequency range.(note) the following is the operation flow how to use ofd. . figure 19-1 ? oscillation frequency detector circuit operation flow tmpm380 can be operated by both internal osc and external osc, however ofd circuit can detect only external osc clock frequenc y using internal osc clock. note) ofd circuit is designed for detecting abnormal oscilla tion however it is not guaranteed that ofd can detect all defects at any time. therefore please design the system carefully assuming there is some possibility that ofd circuit will not work correctly. start internal oscillation reset release reset start external oscillation warm-up detect abnormal external oscillation reset generation check reset factor flag check e clear switch to external oscillation ofdrst disable ofd circuit operation external oscillator is normal? ofdbusy=1 frqerr=0 no yes ofdrst enable t? refer reset flag of chapter ??exception?? ofd detection period period ofd detection period period about 26us error operation
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 2 / 12 - 19.2 configuration the oscillation frequency detecti on circuit is controlled by of dcr1, ofdcr2 registers and the detection frequency range is specified by ofdmx, ofdmn which are the detection frequency setting registers. the lower detection frequency is spec ified by ofdmn registers and the higher detection frequency is specified by ofdmx registers. figure 19-2 shows t he example of frequency detection range. when the oscillation frequency detection is enabled, writing to ofdcr2, ofdmx, ofdmn, ofdrst registers is disabled. therefore, the setting the detection frequency to these registers should be done when the oscillation frequency det ection is disabled. and writing to ofdcr2, ofdmx, ofdmn, ofdrst registers is controlled by ofdcr1 regi ster. to write ofdcr2, ofdmx, ofdmn, ofdrst registers, the write enable code "0xf9" should be set to ofdcr1 beforehand. to enable the oscillation frequency detector, set "0xe4" to ofdcr2 after setting "0xf9" to ofdcr1. since the oscillation fre- quency detection is disabled after an external reset input or por (power on reset), write "0xf9" to ofdcr1 and write "0xe4" to ofdcr2 register to enable its function. when the tmpm380 detects the the frequency which is out of the range setting by ofdmx and ofdmn registers, ofd(oscillatiion freque ncy detection) reset w ill be generated and star ting operation with internal oscillator . (ofd circuit is disable) by the ofd reset, all i/os except power supply pins, reset, x1,x2 and debug pins (pb3-pb7) are initialized as high impedance. if ofd reset is generated by detecting the stopping of high frequency, the internal circ uitries such as registers hold the condition at the timing of oscillation stop. to initialize these internal circuitries, an external re -starting of oscillation is needed. all registers of oscillation frequency detector (ofdcr1, ofdcr2, ofdmx, ofdmn, ofdrst, ofdstat) are initialized by the reset generated from oscillation frequency detector, and then, tmpm380 re-starts from internal osc without detection of external osc?s freque ncy by ofd. therefore it is recommended to check which reset factor was occurr ed by the flag register in intial routine. for the details, please refer the rstflg: reset flag register note) the oscillation frequency detection reset is availabl e only in normal and idle modes. before shifting to stop mode, slow mode and sleep mode, disable the oscillation frequency detection by software figure 19-2 ? detect frequency range (example: 10mhz) fosc2 [mhz] 5 5.15 9 11 19.4 20 9.7 10 10.3 subharmonic of 10mhz+3% 2 frequency detection area high harmonic of 10mhz - 3% 2 frequency detection unknown area
tmpm380/382 tmpm380/382 - 3 / 12 - x1 x2 5;,95(3?+(;(?)<:? ofd ocsillation frequency detector reference clock high-speed oscillator1 (external) high-speed oscillator1 (internal) ta r g et cl o ck ofdcr1 ofdmn ofdmx ofdrst ofdst ofdcr2 ocsillation frequency detector reset ? figure 19-3 internal circut connection of ofd (outline)
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 4 / 12 - 19.3 control the oscillation frequency detection is controlled by oscillation frequency detection control register 2 (ofdcr2). the detection frequency is specified by lower/higher detection frequency setting registers (ofdmn, and ofdmx). writing to ofdcr2, ofdmn, ofdmx, ofdrst is controlled by oscillation frequency detection control register 1 (ofdcr1). 19.3.1.1 oscillation frequency detection control register1(ofdcr1) ofdcr1: 0x4004 _08 00 7 6 5 4 3 2 1 0 bit symbol ofdwen7 ofdwen6 ofdwen5 ofdwen4 ofdwen3 ofdwen2 ofdwen1 ofdwen0 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 1 1 0 function 0x06: disabling of writing to of dcr2/ofdmn/ofdmx (w rite disable code) 0xf9: enabling of writing to ofdc r2/ofdmn/ofdmx(write enable code) others: reserved (note 1) 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? note1) only "0x06" and "0xf9" is valid to ofdcr1. if other value than "0x06" and "0xf9" is written to ofdcr1, "0x06" is written to ofdcr1 automatically.
tmpm380/382 tmpm380/382 - 5 / 12 - 19.3.1.2 oscillation frequency detection control re giste r2 (ofdcr2) ofdcr2: 0x4004_0804 7 6 5 4 3 2 1 0 bit symbol ofden7 ofden6 ofden5 ofden4 ofden3 ofden2 ofden1 ofden0 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function 0x00: disabling of oscillation frequency detection 0xe4: enabling of oscillation frequency detection others: reserved (note 1) 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? note1) only "0x00" and "0xe4" is valid to ofdcr2. writing other value than "0x00" and "0xe4" to ofdcr2 is ignored. norw2) writing to ofdcr2 is protected by setting "0 x06" to ofdcr1 but reading from ofdcr2 is always enabled without setting of ofdcr1.
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 6 / 12 - 19.3.1.3 lower detection frequency setting register (ofdmn) ofdmn: 0x4004_0808 19.3.1.4 higher detection frequency setting register (ofdmx) ofdmx: 0x4004_0810 7 6 5 4 3 2 1 0 bit symbol ofdmx7 ofdmx6 ofdmx5 ofdmx4 ofdmx3 ofdmx2 ofdmx1 ofdmx0 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function set the count value of higher detection frequency 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? note1) ofdmn and ofdmx can not be written when t he oscillation frequency detection circuit is enabled (ofdcr2="0xe4") or writing is disabled with ofdcr1="0x06". an attempt to write ofdmn and ofdmx can not complete a write operation. note2) writing to ofdmn and ofdmx is protected by setting "0x06" to ofdcr1 but reading from ofdmn and ofdmx is always enabled without setting of ofdcr1. 7 6 5 4 3 2 1 0 bit symbol ofdmn7 ofdmn6 ofdmn5 ofdmn4 ofdmn3 ofdmn2 ofdmn1 ofdmn0 read/write r/w r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function set the count value of lower detection frequency 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0?
tmpm380/382 tmpm380/382 - 7 / 12 - 19.3.1.5 oscillation frequency detector reset enable control register (ofdrst) ofdrst: 0x4004_0818 7 6 5 4 3 2 1 0 bit symbol - - - - - - - ofdrsten read/write r r r r r r r r/w after reset 0 0 0 0 0 0 0 1 function always read ?0? 1: enable 0: disable 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? note1) writing to ofdrst is protected by setting "0 x06" to ofdcr1 but reading from ofdrst is always enabled without setting of ofdcr1.
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 8 / 12 - 19.3.1.6 oscillation frequency detector status register (ofdstat) ofdstat: 0x4004_081c 7 6 5 4 3 2 1 0 bit symbol - - - - - - ofdbusy frqerr read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? ofd operation 1: run 2: stop frequency status flag 1: error 0: no error 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0? 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r r r r r r r r after reset 0 0 0 0 0 0 0 0 function always read ?0?
tmpm380/382 tmpm380/382 - 9 / 12 - ? 19.4 function 19.4.1 enabling and disabling the oscillation frequency detection writing "0xe4" to ofdcr2 with ofdcr1="0xf9 " enables the oscillation frequency detection, and writing "0x00" to ofdcr2 with ofdcr1="0xf9" disables the oscillation frequency detection. setting "0xf9" to ofdcr1 enables writing to ofdcr2 and setting "0x06" to ofdcr1 disables writing to ofdcr2. reading from ofdcr2 is always en abled without setting of ofdcr1. ofdcr1 is initialized to "0x06" by external reset and ofdc r2 is initialized to "0x00" by external reset. after writing data to ofdcr2, set "0x06" to ofdcr1 to protect ofdcr2 register. the oscillation frequency detection is available only in normal and idle mode. table 19-1 shows the availability of oscillation fre quen cy detector. table 19-1 availability of o scillation frequency detector operation mode operation of ofd circuit (ofdcr2=0xe4) all i/os condition after reset by ofd (except power supply, reset pins) noraml available high impedance idle available high impedance slow sleep stop (including warnning up period) ofd circuit observes high frequency ocsillation only. be disabled by software before entering this mode reset by oscillation frequency detection reset be initialize (disable) high impedance reset by internal reset (note1) be initialize (disable) high impedance reset by external reset be initialize (disable) - note1) internal reset: watchdog timer reset, ofd reset, sysresetreq reset
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 10 / 12 - tmpm380 has 4-kind of system reset source (por, external reset input, wdt, ofd). and tmpm380 has 2-kind of high clock osc (external, internal). following timming diagram shows the operation and timing of various reset factor including ofd and internal and external clock. figure 19-4 ? the relation of ofd operation and various resets vdd powe r ofd circuit ext. high frequency por powe on reset internal request reset (watchdog timer,etc) ofd reset confirm normal oscillation by frqerr ofd reset enable int. high frequency osc ext. osc on warm-up rset flag registe rset flag registe rset flag registe rset flag registe system clk ofd ref clk disable system clk flag clear flag clear external reset flag clear flag clear ofd ref clk enable disable disable enable ofd ref clk system clk wdt overflow ofd detection enable system clk system clk system clk ofd reset disable ofd on ext. osc on warm-up ofd reset disable ofd on ext. osc on warm-up ofd resetdisable ofd on confirm normal oscillation by frqerr ofd reset enable
tmpm380/382 tmpm380/382 - 11 / 12 - 19.4.2 setting the lower and higher frequency for detection the detection frequency is specified by ofdmn and ofdmx registers. the relation between the setting value to these registers and the detection frequency is shown in table 19-2. table 19 -2 high frequency and setting value for detection frequency tentativ ofdmn detection frequency range [mhz] non detection frequency range [mhz] ofdmx detection frequency range [mhz] non detection frequency range [mhz] 45 5.6 7.0 64 9.9 8.1 46 5.8 7.2 65 10.1 8.2 47 5.9 7.3 66 10.3 8.3 48 6.0 7.5 67 10.4 8.4 49 6.2 7.6 68 10.6 8.6 50 6.3 7.8 69 10.7 8.7 51 6.4 7.9 70 10.9 8.8 52 6.5 8.1 71 11.0 8.9 53 6.7 8.2 72 11.2 9.1 54 6.8 8.4 73 11.3 9.2 55 6.9 8.6 74 11.5 9.3 56 7.0 8.7 75 11.7 9.4 57 7.2 8.9 76 11.8 9.6 58 7.3 9.0 77 12.0 9.7 59 7.4 9.2 78 12.1 9.8 60 7.5 9.3 79 12.3 9.9 61 7.7 9.5 80 12.4 10.1 62 7.8 9.6 81 12.6 10.2 63 7.9 9.8 82 12.7 10.3 64 8.1 9.9 83 12.9 10.5 84 13.0 10.6 85 13.2 10.7 86 13.4 10.8 87 13.5 11.0
19 ocsillation frequency detector (ofd) tmpm380/382 tmpm380/382 - 12 / 12 - 19.4.3 oscillation frequency detection reset if the tmpm380 detects lower frequency spec ified by ofdmn or higher frequency specified by ofdmx, the oscillation frequency detector outputs a reset signal for all i/os. and then, tmpm380 re-start from internal osc without detection of external osc?s frequency by ofd. reset genaration of ofd is controlled by ofdrst. when ofd reset function is enabled:ofdrst=1 after ofdcr1 is written for enable code:?f9h?, reset by ofd is issued. when ofd reset function is disabled:ofdrst=0, reset by ofd is not issued. even ofd reset function is disabled:ofdrst=0, status flag:ofdstat can be checked.
tmpm380/m382 tmpm380/m382 - 13-1 - 20. power-on reset circuit (por) the power-on reset circuit generates a reset when the power is turned on. when the supply voltage is lower than the detection voltage of the power-on re set circuit, a power-on reset signal is generated. 20.1 configuration the power-on reset circuit consists of a refe rence voltage generation circuit, a comparator and a power-on counter . the supply voltage divided by ladder resistor is compared with the voltage ge nerated by the reference voltage generation circuit by the comparator. figure 20-1 power-on reset circuit 20.2 function when power supply voltage goes on, if the supply voltage is equal to or lower than the releasing voltage of the power-on reset circuit, a power-on reset signal is generated. if the power supply voltage exceeds the releasing voltage of the power-on reset ci rcuit, power-on counter is activated and 2 13 /f osc (s) later, a power-on reset signal is released. when power supply voltage goes down, if the suppl y voltage is equal to or lower than the detecting voltage of the power-on reset circuit, a power-on reset signal is generated. during the generation of power-on re set, the power-on counter circuit, the cpu and peripheral circuits are reset. when the power-on reset cuicuit is activated without an external reset input signal, the supply voltage should be increased to the recommended operating volt age range (note) within 0.6ms from the detection of the releasing voltage of the power-on reset circui t. if the supply voltage does not reach the range, the tmpm380/m382 cannot operate properly. power-on reset signal reference voltage generation circuit power-on detection signal power-on counter (note when the supply voltage rises, until the supply voltage (at dvdd5,dvdd5e and rvdd5 pins) reach the recommended operating voltage range (4.5v through 5.5v) and 200 s passes by, the following condition should be satisfied; port l (pl0 and pl1) is opened or the input voltage is within 0.5 volts. rvdd5
tmpm380/m382 tmpm380/m382 - 13-2 - note 1: the power-on reset circuit may operate improperly, dependi ng on fluctuations in the suppl y voltage. refer to the electr ical characteristics and take them into consideration w hen designing equipment. note 2: if the supply voltage is lower than the minimum voltage of power-on reset circuit in which the circuit cannot operate properly, the power-on reset signal becomes undefined value. figure 20-2 operation timing of power-on reset symbol parameter min typ. max unit v porh power-on reset releasing voltage 2.8 3 3.2 v v porl power-on reset detection voltage 2.6 2.8 3.0 v t pordt1 power-on reset release response time 30 s t pordt2 power-on reset detection response time 30 s t porpw power-on reset minimum pulse width 45 s t pwup power-on counter (note 2) 2 13 /f osc s note 1 : since the power-on reset releasing voltage and t he power-on reset detection voltage relatively change, the detection voltage is never reversed. note 2 : 3.2ms at 10mhz. for the details about power-on sequence, refer to the chapter of ?electrical characteristics?. for the details about how to use external reset inpu t, refer to ?reset except ions? in the chapter of ?exceptions?. supply voltage v porh t pordt1 power-on detection signal (low-level enable) v porl minimum voltage of por circuit t pordt2 t porpw power-on reset signal (low-level enable) power-on counte r ?? t pwup t pwup t pordt1 4.0v
tmpm380/m382 tmpm380/m382 - 1 / 4 - 21. voltage detection circuit (vltd) the voltage detection circuit detects any decrease in the supply voltage and generates nmi. note: the voltage detection circuit may operate improperly, depending on fluctuations in the supply voltage (rvdd5). refer to the electrical characte ristics and take them into consideration when designing equipment. 21.1 configuration the voltage detection circuit consists of a refe rence voltage generation ci rcuit, a detection voltage level selection circuit, a comparator and control registers. the supply voltage (rvdd5) is divided by the ladder resistor and input to the detection voltage selection circuit. the detection voltage selection circ uit selects a voltage according to the specified detection voltage (vdlvl), and the comparator compares it with the reference voltage. when the supply voltage (rvdd5) becomes lowe r than the detection voltage (vdlvl), a voltage detection interrupt (nmi) is generated. figure 21-1 voltage detection circuit voltage detection interrupt intvltd reference voltage g eneration circuit vdcr vden detection voltage level selection circuit vdlvl0 vdlvl1 rvdd5
21 voltage detection curcuit (vltd) tmpm380/m382 tmpm380/m382 (rev 0.3) - 2 / 4 - 21.2 control the voltage detection circuit is controlle d by voltage detection control registers. voltage detection control register 7 6 5 4 3 2 1 0 bit symbol - - - - - vdlvl1 vdlvl0 vden read/write r r r r r r/w r/w vdcr (0x4004_0900) after reset 0 0 0 0 0 00 0 vdlvl[1:0] selection for detection voltage 00 : 3.8 0.2 v 01 : 4.1 0.2 v 10 : 4.4 0.2 v 11 : 4.6 0.2 v vden enables/disables the operation of voltage detection 0 : disables the operation of voltage detection 1 : enables the operation of voltage detection note 1: vdcr is initialized by a pow er-on reset or an external reset input. voltage detection status register 7 6 5 4 3 2 1 0 bit symbol - - - - - - - vdsr read/write r r r r r r r r vdsr (0x4004_0904) after reset 0 0 0 0 0 0 0 0 vdsr voltage detection status register 0 : power supply voltage is higher than the detection voltage specified by vdlvl[1:0]. 1 : power supply voltage is lower than the detection voltage specified by vdlvl[1:0].
tmpm380/m382 tmpm380/m382 - 3 / 4 - 21.3 function the detection voltage can be selected by vdcr. enabling/disab ling the voltage detection can be programmed by vdcr. after the voltage detection operation is enabled, when the supply voltage (rvdd5) becomes lower than the detection voltage , a voltage detection interrupt (nmi) is generated. 21.3.1 enabling/disabling the voltage detection operation setting vdcr to "1" enables the voltage detect ion operation. setting it to "0" disables the operation. vdcr is cleared to "0" immediately after a po wer-on reset or a reset by an external reset input is released. note: when the supply voltage (rvdd5) is lower than the detection voltage (vdlvl), setting vdcr to "1" generates a voltage detection interrupt (nmi) at the time.
21 voltage detection curcuit (vltd) tmpm380/m382 tmpm380/m382 (rev 0.3) - 4 / 4 - 21.3.2 selecting the detection voltage level select a detection voltage at vdcr. power voltage vltd etection voltage tvdpw voltage detection voltage detection reset signal tvddt1 tvddt2 power-on reset signal tvden por etection voltage software software tvddt1 tvden figure 21-2 voltage detection timing symbol parameter min typ. max unit t vden setup time after enabling voltage detection 40 s t vddt1 voltage detection response time 40 s t vddt2 voltage detection releasing time 40 s t vdpw voltage detection minimum pulse width 45 s
tmpm380/m382 tmpm380/m382 - 1 / 26 - 22 dma controller (dmac) tmpm380/m382 has a dma controller controlled by dma request select registers 22.1 function overview the table below lists its major functions. table 22-1 dma controller functions item function overview number of channels 2ch hardware start supports 14 types of dma requests for peripheral ips. software start started with a write to the dmacsoftbreq register. bus master 32bit 1 (ahb) priority dma channel 0 (high) to dm a channel 1 (low) fixed by hardware fifo 4word 2ch bus width 8/16/32bit settable individually for transfer source and destination burst size 1/4/8/16/32/64/128/256 number of transfers up to 4095 transfer source address incr / no-incr address transfer destination address incr / no-incr it is possible to specify whether source and destination addresses should increment or should not increment (should be fixed). (address wrapping is not supported.) endian only little endian is supported. transfer type peripheral circuit (register) memory memory peripheral circuit (register) memory memory (note1) when "memory memory" is selected, hardware start for dma startup is not supported. see the dmaccxconfiguration register for more information. interrupt function transfer end interrupt error interrupt special function scatter/gather function * 1 word = 32 bits note1) follows transfer type is not supported from peripheral circuit (regist er) to peripheral circuit (register)
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 2 / 26 - 22.2 dma transfer type transfer type are supported following 3-kinds type. the condition of each transfer type are showed the following table. table 22-2 dma transfer type dma direction dma request circuit support dma request (note2) other condtion 1 memory peripheral circuit (register) peripheral circuit (destination) burst request in case of 1word transmission, set to the ?1? for burst size of dma controller. 2 peripheral circuit (register) memory peripheral circuit source burst request /single request (note1) if the amount of data transfer is not an integral multiple of the burst size, both burst and single transfers are used. amount of remaining transfer data burst size ? uses burst transfer. amount of remaining transfer data < burst size ? uses single transfer 3 memory memory dmac - start condition: enabling the dmac starts data transfer with no dmac request required. use condition: transfer of all transfer data is complete. the dmac channel is disabled. note1) single request circuit in this micro controller: ssp note2) internal connection of dma request: refer the next page please.
tmpm380/m382 tmpm380/m382 - 3 / 26 - 22.3 block diagram figure 22-1 block diagram table 22-3 dma request number chart corresponding peripheral dma request no. burst single 0 sio0 reception / transmission - 1 sio1 reception / transmission - 2 sio2 reception / transmission - 3 sio3 reception / transmission - 4 sio4 reception / transmission - 5 ssp0 transmission - 6 ssp0 reception ssp0 reception 7 ssp1 transmission - 8 ssp1 reception ssp1 reception 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - [15] [14] [13] [12] [11] [10] [9] [8] [7] [6] [5] [4] [3] [2] [1] [0] ahb master i/f 2 ahb slave i/f burst request single request cpu data. ahb dma request and response i/f channel logic and register control logic and register interrupt request - - - - - - - ssp1 reception ssp1 transmission ssp0 reception ssp0 transmission sio4 reception/transmission sio3 reception/transmission sio2 reception/transmission sio1 reception/transmission sio0 reception/transmission [15] [14] [13] [12] [11] [10] [9] [8] [7] [6] [5] [4] [3] [2] [1] [0] - - - - - - - ssp1 reception - ssp0 reception - - - - - - intdmacerr intcmactc dmacclr[15:0]
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 4 / 26 - 22.4 description of registers 22.4.1 dmac register list the following lists the sfrs and their functions: table22-4 sfr list note) access the registers by using word reads and word writes. register name address (base+) description dmacintstaus 0x0000 dmac interrupt status register dmacinttcstatus 0x0004 dmac interrupt terminal count status register dmacinttcclear 0x0008 dmac interrupt terminal count clear register dmacinterrorstatus 0x000c dmac interrupt error status register dmacinterrclr 0x0010 dmac interrupt error clear register dmacrawinttcstatus 0x0014 dmac raw interr upt terminal count status register dmacrawinterrorstatus 0x0018 dmac raw error interrupt status register dmacenbldchns 0x001c dmac enabled channel register dmacsoftbreq 0x0020 dmac software burst request register dmacsoftsreq 0x0024 dmac software single request register ? 0x0028 reserved ? 0x002c reserved dmacconfiguration 0x0030 dmac configuration register ? 0x0034 reserved dmacc0srcaddr 0x0100 dmac channel0 source address register dmacc0destaddr 0x0104 dmac channel0 destination address register dmacc0lli 0x0108 dmac channel0 linked list item register dmacc0control 0x010c dmac channel0 control register dmacc0configuration 0x0110 dmac channel0 configuration register dmacc1srcaddr 0x0120 dmac channel1 source address register dmacc1destaddr 0x0124 dmac channel1 destination address register dmacc1lli 0x0128 dmac channel1 linked list item register dmacc1control 0x012c dmac channel1 control register dmacc1configuration 0x0130 dmac channel1 configuration register base address= 0x4008_0000
tmpm380/m382 tmpm380/m382 - 5 / 26 - 22.4.2 dmacintstatus (dmac interrupt status register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] intstatus1 r 0y0 status of dmac channel 1 interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [0] intstatus0 r 0y0 status of dmac channel 0 interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [explanation] a. status of the dmac interrupt generation after passing through the transfer end interrupt enable register and error interrupt enable register. an interrupt is requested when there is a transfer error or when the counter completes counting. figure 22-2 interrupt-related block diagram dmacc0configuration dmacc0configuration dmacinttcstatus (post-enable transfer error interrupt) dmacinterrorstatus (post-enable transfer error interrupt) dmacintstatus dmacrawinttcstatus (pre-enable transfer end interrupt) dmacrawinterrorstatus (pre-enable transfer error interrupt) dma transfer end dma transfer error a ddress = (0x4008_0000) + 0x0000
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 6 / 26 - 22.4.3 dmacinttcstatus (dmac interrupt terminal count status register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] inttcstatus1 r 0y0 status of dmac channel 1 transfer end interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [0] inttcstatust0 r 0y0 status of dmac channel 0 transfer end interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [explanation] b. the status of post-enable trans fer end interrupt generation. a ddress = (0x4008_0000) + 0x0004
tmpm380/m382 tmpm380/m382 - 7 / 26 - 22.4.4 dmacinttcclear (dmac interrupt terminal count clear register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] inttcclear1 w 0y0 clear dmac channel 1 transfer end interrupt 0y1: clear 0y0: do nothing [0] inttcclear0 w 0y0 clear dmac channel 0 transfer end interrupt 0y1: clear 0y0: do nothing [explanation] c. the dmacinttcs register bit of the channel that co rresponds to the bit to which "1" was written will clear the interrupt. a ddress = (0x4008_0000) + 0x0008
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 8 / 26 - 22.4.5 dmacinterrorstatus (dmac interrupt error status register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] interrstatus1 r 0y0 status of dmac channel 1 error interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [0] interrstatus0 r 0y0 status of dmac channel 0 error interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [explanation] d. error interrupt status after enabled a ddress = (0x4008_0000) + 0x000c
tmpm380/m382 tmpm380/m382 - 9 / 26 - 22.4.6 dmacinterrclr (dmac interrupt error clear register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] interrclr1 w 0y0 clear dmac channel 1 error interrupt 0y1: clear 0y0: do nothing [0] interrclr0 w 0y0 clear dmac channel 0 error interrupt 0y1: clear 0y0: do nothing [explanation] e. "1": clears an error interrupt request. a ddress = (0x4008_0000) + 0x0010
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 10 / 26 - 22.4.7 dmacrawinttcstatus (dmac raw interrupt terminal count status register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] rawinttcs1 r 0y0 status of dmac channel 1 pre-enable transfer end interrupt generation 0y1: interrupt requested 0y0: interrupt not requested [0] rawinttcs0 r 0y0 status of dmac channel 0 pre-enable transfer end interrupt generation 0y1: interrupt requested 0y0: interrupt not requested [explanation] f. < rawinttcs [1:0]> "1": interrupt requested for pr e-enable transfer end interrupt. a ddress = (0x4008_0000) + 0x0014
tmpm380/m382 tmpm380/m382 - 11 / 26 - 22.4.8 dmacrawinterrorstatus (dmac raw error interrupt status register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] rawinterrs1 r 0y0 status of dmac channel 1 pre-enable error interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [0] rawinterrs0 r 0y0 status of dmac channel 0 pre-enable error interrupt generation. 0y1: interrupt requested 0y0: interrupt not requested [explanation] g. < rawinterrs [1:0]> "1": interrupt requested for pre-enable error interrupt. a ddress = (0x4008_0000) + 0x0018
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 12 / 26 - 22.4.9 dmacenbldchns (dmac enabled channel register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] enabledch1 r 0y0 dma channel 1 enable status 0y1: enable 0y0: disable [0] enabledch0 r 0y0 dma channel 0 enable status 0y1: enable 0y0: disable [explanation] h. "0": the bits of the appropriate channel ar e cleared when dma transfer is complete. "1": the appropriate channel dma is enabled. a ddress = (0x4008_0000) + 0x001c
tmpm380/m382 tmpm380/m382 - 13 / 26 - 22.4.10 dmacsoftbreq (dmac software burst request register) bit bit symbol type reset value description [31:9] ? ? undefined read undefined. write as zero. [8] softbreq8 r/w 0y0 dma burst request by software at. ssp1 reception 0y1: dma burst requested 0y0: disabled (wr) [7] softbreq7 r/w 0y0 dma burst request by software at ssp1 transmission 0y1: dma burst requested 0y0: disabled (wr) [6] softbreq6 r/w 0y0 dma burst request by software at ssp0 reception 0y1: dma burst requested 0y0: disabled (wr) [5] softbreq5 r/w 0y0 dma burst request by software at ssp0 transmission 0y1: dma burst requested 0y0: disabled (wr) [4] softbreq4 r/w 0y0 dma burst request by software at sio4 transmission and reception 0y1: dma burst requested 0y0: disabled (wr) [3] softbreq3 r/w 0y0 dma burst request by software at sio3 transmission and reception 0y1: dma burst requested 0y0: disabled (wr) [2] softbreq2 r/w 0y0 dma burst request by software at sio2 transmission and reception 0y1: dma burst requested 0y0: disabled (wr) [1] softbreq1 r/w 0y0 dma burst request by software at sio1 transmission and reception 0y1: dma burst requested 0y0: disabled (wr) [0] softbreq0 r/w 0y0 dma burst request by software at sio0 transmission and reception 0y1: dma burst requested 0y0: disabled (wr) [explanation] i. sets a dma burst transfer reque st by software. when the dma burst transfer by software is complete, the appropriate bits in softbreq[8:0] are cleared. note) do not execute dma requests by software and hardware peripheral at the same time. a ddress = (0x4008_0000) + 0x0020
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 14 / 26 - 22.4.11 dmacsoftsreq (dmac software single request register ) bit bit symbol type reset value description [31:9] ? ? undefined read undefined. write as zero. [8] softsreq8 r/w 0y0 dma single request by software at ssp1 reception 0y1: generate a dma single request 0y0: disabled (wr) [7] ? ? undefined read undefined. write as zero. [6] softsreq6 r/w 0y0 dma single request by software at ssp0 reception 0y1: generate a dma single request 0y0: disabled (wr) [5:0] ? ? undefined read undefined. write as zero. [explanation] j. , sets a dma single transfer request by software. when the dma single transfer by software is complete, softsreq[8] or softsreq[6] are cleared. note) do not execute a dma request by software when a dma request by hardware peripheral is generated. a ddress = (0x4008_0000) + 0x0024
tmpm380/m382 tmpm380/m382 - 15 / 26 - 22.4.12 dmacconfiguration (dmac configuration register) bit bit symbol type reset value description [31:2] ? ? undefined read undefined. write as zero. [1] m r/w 0y0 dma1 endian types: 0: little endian 1: reserved [0] e r/w 0y0 dma circuit control: 0 : stop 1 : operate [explanation] k. dma endian configuration l. the registers for the dma circuit cannot be written or read unless the dma circuit operates. when operating the dma, always keep the dma circuit operating. a ddress = (0x4008_0000) + 0x0030
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 16 / 26 - 22.4.13 dmacc0srcaddr (dmac channel0 source address register) bit bit symbol type reset value description [31:0] srcaddr r/w 0x00000000 sets a dma transfer source address [explanation] m. because enabling channels updates the data wri tten in the registers, set dmaccxsrcaddr before enabling the channels. when the dma is operating, the value in the dm accxsrcaddr register sequentially changes, so the read values are not fixed. do not update dmacc0srcaddr during transfer. to change the value, be sure to set the dmaccxconfiguration register to disable the channel before change. ? dmaccxsrcaddr (dmac channel x so urce address register) (x = 1) refer to the description on dmacc0srcaddr bec ause the structures and explanations on the above registers are the same as dmacc0srcaddr. also, refer to table22-4 sfr list for register name s an d addresses. a ddress = (0x4008_0000) + 0x0100
tmpm380/m382 tmpm380/m382 - 17 / 26 - 22.4.14 dmacc0destaddr (dmac channel0 destination address register) bit bit symbol type reset value description [31:0] destaddr r/w 0x00000000 sets a dma transfer destination address [explanation] n. do not update dmacc0destaddr during transfer. to change the value, be sure to set the dmaccxconfiguration register to disable the channel before change. ? dmaccxdestaddr (dmac channel x dest ination address register) (x = 1) refer to the description on dmacc0destaddr because the structures and explanations on the above registers are the same as dmacc0destaddr. also, refer to table22-4 sfr list for regi ster n ame s and addresses. a ddress = (0x4008_0000) + 0x0104
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 18 / 26 - 22.4.15 dmacc0lli (dmac channel0 linked list item register) bit bit symbol type reset value description [31:2] lli r/w 0x00000000 sets the first address of the next transfer information. [1:0] ? ? undefined read undefined. write as zero. [explanation] o. set a value smaller than 0xffff_fff0 for . when = 0, currently, lli is the last chain. after dma transfer finishes, the dma channel is disabled. * for detailed operation, see 22.5 ?special function? ? dmaccxlli (dma c channel x linked list item register) (x = 1) refer to the description on dmacc0lli because the structures and ex planations on the above registers are the same as dmacc0lli. also, refer to table22-4 sfr list for register names and addresses. a ddress = (0x4008_0000) + 0x0108
tmpm380/m382 tmpm380/m382 - 19 / 26 - 22.4.16 dmacc0control (dmac channel0 control register) bit bit symbol type reset value description [31] i r/w 0y0 register for enabling a transfer end interrupt when the scatter/gather function is used 0y0 : disable 0y1 : enable [30:28] ? ? undefined read undefined. write as zero. [27] di r/w 0y0 increment the transfer destination address 0y0: do not increment 0y1: increment [26] si r/w 0y0 increment the transfer source address 0y0: do not increment 0y1: increment [25:24] ? ? undefined read undefined. write as zero. [23:21] dwidth[2:0] r/w 0y000 transfer destination bit width 0y000: byte (8 bits) 0y001: half-word (16 bits) 0y010: word (32 bits) other: reserved [20:18] swidth[2:0] r/w 0y000 transfer source bit width 0y000: byte (8 bits) 0y001: half-word (16 bits) 0y010: word (32 bits) other: reserved [17:15] dbsize[2:0] r/w 0y000 transfer destination burst size: 0y000: 1 beat 0y001: 4 beats 0y010: 8 beats 0y011: 16 beats 0y100: 32 beats 0y101: 64 beats 0y110: 128 beats 0y111: 256 beats [14:12] sbsize[2:0] r/w 0y000 transfer source burst size: 0y000: 1 beat 0y001: 4 beats 0y010: 8 beats 0y011: 16 beats 0y100: 32 beats 0y101: 64 beats 0y110: 128 beats 0y111: 256 beats [11:0] transfersize r/w 0x000 set the total number of transfers a ddress = (0x4008_0000) + 0x010c
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 20 / 26 - [explanation] the same explanation is applied for the other channels too. p. register for enabling a transfer end interrupt when the scatter/gather function is used q. increments the address of a transfer destination. depends on the bit width of the transfer sour ce. increments the address, each depending on dwidth as follows: 8-bit : 1 byte 16-bit : 2 bytes 32-bit : 4 bytes r. increments the address of a transfer destination. depends on the bit width of the transfer sour ce. increments the address, each depending on swidth as follows: 8-bit : 1 byte 16-bit : 2 bytes 32-bit : 4 bytes s. set a transfer destination bit width so that the tr ansfer size becomes an integral multiple of the transfer destination bit width. t. note) the burst size to be set with dbsize has nothing to do with the hburst for the ahb bus. u. note) the burst size to be set with sbsize has nothing to do with the hburst for the ahb bus. v. set the total number of transfers when the dmac is used as the flow controller. this value decrements to "0" as dmac transfer is executed. the read operation reads the number of transfers that have not been executed yet. the total number of transfers is used as the unit for the transfer source bit width. ex: when swidth=8bit, the number of transfer s is expressed in the units of byte. ex: when swidth=16bit, the number of transfers is expressed in the units of half word. ex: when swidth=32bit, the number of transfers is expressed in the units of word. note) if the transfer source bit width is smaller than the tr ansfer destination bit width, ca re must be taken when setting
tmpm380/m382 tmpm380/m382 - 21 / 26 - the total number of transfers. set the number so that the following expression is satisfied: transfer source bit width total number of transfers = transfer destination bit width n n: integer number ? dmaccxcontrol (dmac channel x control register) (x = 1) refer to the description on dmacc0control be cause the structures and explanations on the above registers are the same as dmacc0control. also, refer to table22-4 sfr list for register names an d addresses.
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 22 / 26 - 22.4.17 dmacc0configuration (dmac channel0 configuration register) bit bit symbol type reset value description [31:19] ? ? undefined read undefined. write as zero. [18] halt r/w 0y0 0y0: accept a dma request 0y1: ignore a dma request [17] active r 0y0 0y0: no data exists in the fifo 0y1: data exists in the fifo [16] lock r/w 0y0 0y0: disable locked transfer 0y1: enable locked transfer [15] itc r/w 0y0 transfer end interrupt enable register 0y0: disable interrupt 0y1: enable interrupt [14] ie r/w 0y0 error interrupt enable register 0y0: disable interrupt 0y1: enable interrupt [13:11] flowcntrl r/w 0y000 flowcntrl setting value transfer method 0y000 memory to memory 0y001 memory to peripheral 0y010 peripheral to memory 0y011 reserved 0y100~0y111: reserved [10] ? ? undefined read undefined. write as zero. [9:6] destperipheral r/w 0y000 transfe r destination peripheral (note 1) 0y000 0y1111 [5] ? ? undefined read undefined. write as zero. [4:1] srcperipheral r/w 0y000 transfer source peripheral (note 1) 0y000 0y1111 [0] e r/w 0y0 channel enable 0y0 : disable 0y1 : enable note) refer to dma request number chart. [explanation] w. halts dma. x. indicates whether data is present in the channel fifo. y. sets a locked transfer (non-divided transfer). when locked transfer is enabled, as many burst transfers as specified ar e consecutively executed without releasing the bus. z. transfer end interrupt enable a ddress = (0x4008_0000) + 0x0110
tmpm380/m382 tmpm380/m382 - 23 / 26 - aa. error interrupt enable bb. sets a transfer method. 0y000: memory to memory 0y001: memory to peripheral 0y010: peripheral to memory 0y011: reserved 0y100~0y111: reserved note) when "memory to memory" is selected, hardware star t for dma startup is not supported. writing to = 1 starts transfer. cc. the dma request peripheral number is expressed by binary. when a memory is the transfer destination, this setting is ignored. dd. the dma request peripheral number is expressed by binary. when a memory is the transfer source, this setting is ignored. ee. this bit can be used to enable/disable the channels. disabling channels during transfer loses the data in the fifo. initialize all the channels before restart. to pause the transfer, stop the dma request by using the bit, and poll the data until the bit becomes "0" and then disable the channel with the bit. ? dmaccxconfiguration (dmac channel x configuration register) (x = 1) refer to the description on dmacc0configurati on because the structures and explanations on the above registers are the same as dm acc0configuration. also, refer to table22-4 sfr list for regi ster n ame s and addresses.
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 24 / 26 - 22.5 special functions 22.5.1 scatter/gather function when removing a part of image data and transferring it, image data cannot be handled as consecutive data, and the address changes dram atically depending on the special rule. since dma can transfer data only by using consecutive addres ses, it is necessary to make required settings at locations where addresses changes. the scatter/gather function can consecutively operate dma settings (transfer source address, destination address, number of tr ansfers, and transfer bus width) by re-loading them each time a specified number of dma executions have comp leted via a pre-set "linked list" where the cpu does not need to control the operation. setting "1" in the dmaccxlli register enables/disables the operation. the items that can be set with linked list are configured with the following 4 words: 1) dmaccxsrcaddr 2) dmaccxdestaddr 3) dmaccxlli 4) dmaccxcontrol they can be used with the interrupt operation. an interrupt depends on the terminal count inte rrupt enable bit of the dmaccxcontrol register, and can be generated at the end of each lli. when this bit is used, a condition can be added even during transfer using lli to perform branch oper ation, etc. to clear the interrupt, control the appropriate bit of the dmacinttcclear register. screen image remove a part of the screen image screen data addresses are not successive
tmpm380/m382 tmpm380/m382 - 25 / 26 - 22.5.2 linked list operation to operate the scatter/gather function, a transfer source and destination data areas need to be defined by creating a set of linked lists first. each setting is called lli (linkedlist). each lli controls the transfer of one block of data. each lli indicates normal dma setting and controls transfer of successive data. each ti me each dma transfer is complete, the next lli setting will be loaded to continue the dma operation (daisy chain). an example of the setting is shown below. 1. the first dma transfer setting should be made directly in the dma register. 2. the second and subsequent dma transfer setti ngs should be written in the addresses of the memory set in "next lli addressx." 3. to stop up to n'th dma transfer, set "next lli addressx" to 0x00000000. destination memory image transfer source memory image sourceaddress1 destination address1 next lli address2 control register value sourceaddress2 destination address2 next lli address2 control register value sourceaddressn destination addressn 0x00000000 control register value +0 +4 +8 +c ? lli address2 lli addressn directly set in the dma setting register
22 dma controller (dmac) tmpm380/m382 tmpm380/m382 - 26 / 26 - example: setting example to transfer the area enclosed by the square in the left figure. dmaccxsrcaddr: 0x0a200 dmaccxdestaddr: dest ination address 1 dmaccxlli: 0x200000 dmaccxcontrol: set the number of burst tr ansfers and the number of transfers, etc. 0x0a000 0x0b000 0x0c000 0x00200 0x00e00 0x0b200(srcaddr) dest addr2 0x200010 control register value 0x0c000(srcaddr) dest addr3 32'h00000000 control register value 0x200000 +4 +8 +c 0x200010 +4 +8 +c this lli indicates the end linked list
tmpm380/m382 tmpm380/m382 - 1 / 54 - 23 flash memory operation this section describes the hardware configuration and operation of the flash memory. 23.1 flash memory 23.1.1 features 1) memory capacity the tmpm380/382 contains flash memory. t he memory sizes and configurations are shown in the table below. independent write ac cess to each block is available. when the cpu is to access the internal flash memory, 32-bit data bus width is used. 2) write/erase time writing is executed per page. the tmpm380/382 contains 64 words in a page. page writing requires 1.25ms (typical ) regardless of number of words. a block erase requires 0.1 s. (typical). the following table shows write and erase time per chip. block configuration product name memory size 128kb 64kb 32kb 16kb # of words write time erase time tmpm380fy 256kb 0 3 1 2 64 1.28s 0.4s tmpm380/382fw 128kb 0 1 1 2 64 1.28s 0.4s tmpm382fs 64kb 0 0 1 2 64 1.28s 0.4s (note) the above values are theoretical values not including data transfer time. the write time per chip depends on the write method to be used by the user. 3) programming method the onboard programming mode is available for the user to program (rewrite) the device while it is mounted on the user's board. ? the onboard programming mode 3-1) user boot mode the user's original rewriting method can be supported. 3-2) single boot mode the rewriting method to use serial data transfer (toshiba's unique method) can be supported. rewriting method the flash memory included in this device is generally compliant with the applicable jedec standards except for some specific functions. theref ore, if the user is currently using an external flash memory device, it is easy to implement t he functions into this device. furthermore, the user is not required to build his/her own programs to realize complicated write and erase functions because such functions are automatically performed using the circuits already built-in the flash memory chip. this device is also implemented with a read-protect function to inhibit reading flash memory data from any external writer device. on the other hand, rewrite protection is available only through command-based software programmi ng; any hardware setting method to apply +12vdc is not supported. see chapter 24 for det ails of rom protection and security function.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 2 / 54 - jedec compliant functions modified, added, or deleted functions ? automatic programming ? automatic chip erase ? automatic block erase ? data polling/toggle bit block protect (only software protection is supported) erase resume - suspend function 23.1.2 block diagram of the flash memory section fig 23-1 block diagram of the flash memory section internal address bus rom controller control a ddress data flash memory column decoder/sense amplifier data latch address latch erase block decoder control circuit (includes automatic sequence control) command register internal data bus internal control bus flash memory cell row decoder
tmpm380/m382 tmpm380/m382 - 3 / 54 - 23.2 operation mode this device has three operation modes including the mode not to use the internal flash memory. table 23-1 operation modes operation mode operation details single chip mode normal mode user boot mode after reset is cleared, it starts up from the internal flash memory. in this operation mode, two different modes, i.e., the mode to execute user application programs and the mode to rewrite the flash memory onboard the user?s card, are defined. the former is referred to as "normal mode" and the latter "user boot mode. the user can uniquely configure the system to switch between these two modes. for example, the user can freely design the system such that the normal mode is selected when the port "a0" is set to "1" and the user boot mode is selected when it is set to "0." the user should prepare a routine as part of the application program to make the decision on the selection of the modes. single boot mode after reset is cleared, it starts up from the internal boot rom (mask rom). in the boot rom, an algorithm to enable flash memory rewriting on the user?s set through the serial port of this device is programmed. by connecting to an external host computer through the serial port, the internal flash memory can be programmed by transferring data in accordance with predefined protocols. among the flash memory operation modes listed in t he above table, the user boot mode and the single boot mode are the programmable modes. these two modes, the user boot mode and the single boot mode, are referred to as "onboard programming" modes where onboard rewriting of internal flash memory can be made on the user's card.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 4 / 54 - either the single chip or single boot operation mode can be selected by externally setting the level of the boot (pl0) pin while the device is in reset status. after the level is set, the cpu starts operation in the selected operation mode when the reset condition is removed. regarding the boot (pl0) pin, be sure not to change the levels during operation once the mode is selected. the mode setting method and the mode transition diagram are shown below: table 23-2 operation mode setting pin operation mode reset boot (pl0) single chip mode 0 1 1 single boot mode 0 1 0 fig 23-2 mode transition diagram 23.2.1 reset operation to reset the device, ensure that the power supply voltage is within the operating voltage range, that the internal oscillator has been stabilized, and that the reset input is held at "0" for a minimum duration of 12 system clocks (0.3 s with 40mhz operation; the "1/1" clock gear mode is applied after reset). onboard programming mode user to set the switch method single chip mode reset state normal mode user boot mode single boot mode (note 1) regarding power-on reset of devices with internal flash memory; for devices with internal flash memory, it is necessary to apply "0" to the reset inputs upon power on for a minimum duration of 300 microseconds regardless o f the operating frequency. (note 2) while flash auto programming or deletion is in progress, at least 0.5 microseconds of reset period is required regardless of the system clock frequency. in this condition, it takes approx. 2 ms to enable reading after reset. ?
tmpm380/m382 tmpm380/m382 - 5 / 54 - 23.2.2 user boot mode (single chip mode) user boot mode is to use flash memory progra mming routine defined by users. it is used when the data transfer buses for flash memory program code on the old application and for serial i/o are different. it operates at the single chip mode; therefore, a switch from normal mode in which user application is activated at the single chip mode to user boot mode for programming flash is required. specifically, add a mode judgment routine to a reset program in the old application. the condition to switch the modes needs to be set by using the i/o of tmpm380/382 in conformity with the user?s system setup c ondition. also, flash memory programming routine that the user uniquely makes up needs to be set in the new application. this routine is used for programming after being switched to user boot mode. the execution of the programming routine must take place while it is stored in the area other than the flash memory since the data in the internal flash memory cannot be read out during delete/ writing mode. once re-programming is complete, it is recommen ded to protect relevant flash blocks from accidental corruption during subsequent si ngle-chip (normal mode) operations. all the interruption including a non-maskable ar e inhibited at user boot mode. (1-a) and (1-b) are the examples of programming with routines in the internal flash memory and in the external memory. for a detailed description of the erase and program sequence, refer to on-board programming of flash memory (rewrite/erase).
23 flash memory operation tmpm380/m382 tmpm380/m382 - 6 / 54 - user boot mode (1-a) method 1: storing a programming routine in the flash memory (step-1) determine the conditions (e.g., pin states) required fo r the flash memory to enter user boot mode and the i/o bus to be used to transfer new program code. create hardware and software accordingly. before installing the tmpm380/382 on a printed circuit board, write the following program routines into an arbitrary flash block using programming equipment. (a) mode judgment routine: code to determine whether or not to switch to user boot mode (b) programming routine: code to download new program code from a host controller and re-program the flash memory (c) copy routine: code to copy the data descri bed in (b) from the tmpm380/382 flash memory to either the tmpm380/382 on-chip ra m or external memory device. (step-2) after reset is released, the reset procedure determines whether to put the tmpm380/382 flash memory in user boot mode. if mode switching condit ions are met, the flash memory enters user boot mode. (all interrupts including nmi must be disabled while in user boot mode.) (tmpm380/382) flash memory [reset procedure] (a) mode judgment routine old application program code (host) new application program code (i/o) (b) programming routine (c) copy routine ram flash memory old application program code [reset procedure] (a) mode judgment routine (b) programming routine (c) copy routine 0 1 reset conditions for entering user boot mode (defined by the user) ram (host) (i/o) new application program code (tmpm380/382)
tmpm380/m382 tmpm380/m382 - 7 / 54 - (step - 3) once transition to user boot mode is occurred, execute the copy routine (c) to copy the flash programming routine (b) to the tmpm380/382 on-chip ram. (step - 4) jump program execution to the flash programming r outine in the on-chip ram to erase a flash block containing the old application program code. (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine old application program code (host) new application program code (i/o) (b) programming routine (c) copy routine (b) programming routine (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine (host) new application program code (i/o) (b) programming routine (c) copy routine (b) ` (b) programming routine (erased)
23 flash memory operation tmpm380/m382 tmpm380/m382 - 8 / 54 - (step - 5) continue executing the flash programming routi ne to download new program code from the host controller and program it into the erased flash block. once programming is complete, turn on the protection of that flash block. (step - 6) set reset to ?0? to reset the tmpm380/382. upon reset, t he on-chip flash memory is put in normal mode. after reset is released, the cpu will start execut ing the new application program code. (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine new application program code (host) new application program code (i/o) (b) programming routine (c) copy routine (b) ` (b) programming routine flash memory ram [reset procedure] (a) mode judgment routine new application program code (host) (b) programming routine (c) copy routine set to normal mode (tmpm380/382) (i/o) 0 1 reset
tmpm380/m382 tmpm380/m382 - 9 / 54 - (1-b) method 2: transferring a progra mming routine from an external host (step - 1) determine the conditions (e.g., pin states) required fo r the flash memory to enter user boot mode and the i/o bus to be used to transfer new program code. create hardware and software accordingly. before installing the tmpm380/382 on a printed circuit board, write the following program routines into an arbitrary flash block using programming equipment. (a) mode judgment routine: code to determine whether or not to switch to user boot mode (b) transfer routine: code to download new program code from a host controller also, prepare a programming routine shown below on the host controller: (c) programming routine: code to download new program code from an external host controller and re-program the flash memory (step - 2) after reset is released, the reset procedure determines whether to put the tmpm380/382 flash memory in user boot mode. if mode switching condit ions are met, the flash memory enters user boot mode. (all interrupts including nmi must be disabled while in user boot mode). (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine old application program code (host) new application program code (i/o) (b) transfer routine (c) programming routine (tmpm380/382) (host) (i/o) 0 1 reset conditions for entering user boot mode (defined by the user) flash memory ram [reset procedure] (a) mode judgment routine old application program code (b) transfer routine new application program code (c) programming routine
23 flash memory operation tmpm380/m382 tmpm380/m382 - 10 / 54 - (step - 3) once user boot mode is entered, execute the tran sfer routine (b) to download the flash programming routine (c) from the host controlle r to the tmpm380/382 on-chip ram. (step - 4) jump program execution to the flash programming r outine in the on-chip ram to erase a flash block containing the old application program code. (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine old application program code (host) new application program code (i/o) (b) transfer routine (c) programming routine (c) programming routine (tmpm380/382) flash memory ram [reset procedure] (a) mode judgment routine (host) new application program code (i/o) (b) transfer routine (c) programming routine (c) programming routine (erased)
tmpm380/m382 tmpm380/m382 - 11 / 54 - (step - 5) continue executing the flash programming routi ne to download new program code from the host controller and program it into the erased flash block. once programming is complete, turn on the protection of that flash block. (step - 6) set reset to ?0? low to reset the tmpm380/382. upon reset, the on-chip flash memory is put in normal mode. after reset is released, the cpu will start execut ing the new application program code. (tmpm380 / 382) flash memory ram [reset procedure] (a) mode judgment routine new application program code (host) new application program code (i/o) (b) transfer routine (c) programming routine (c) programming routine (tmpm380 / 382) (host) (i/o) 0 1 reset set to normal mode flash memory ram [reset procedure] (a) mode judgment routine new application program code (b) transfer routine
23 flash memory operation tmpm380/m382 tmpm380/m382 - 12 / 54 - 23.2.3 single boot mode in single boot mode, the flash memory can be re-programmed by using a program contained in the tmpm380/382 on-chip boot rom. this boot rom is a masked rom. when single boot mode is selected upon reset, the boot rom is mapped to the address region including the interrupt vector table while the flash memory is mapped to an address region different from it. single boot mode allows for serial programmi ng of the flash memory. channel 0 of the sio (sio0) of the tmpm380/382 is connected to an exte rnal host controller. via this serial link, a programming routine is downloaded from the host controller to the tmpm380/382 on-chip ram. then, the flash memory is re-programmed by executing the programmi ng routine. the host sends out both commands and programming data to re-program the flash memory. communications between the sio0 and the host must follow the protocol described later. to secure the contents of the flash memory, the valid ity of the application?s password is checked before a programming routine is downloaded into the on-chip ram. if password matching fails, the transfer of a programming routine itself is aborted. as in the case of user boot mode, all interrupt s including the non-maskable interrupt (nmi) must be disabled in single boot mode while the flash memory is being erased or programmed. in single boot mode, the boot-rom progr ams are executed in normal mode. once re-programming is complete , it is recommended to protec t relevant flash blocks from accidental corruption during subsequent single-chip (normal mode) operations.
tmpm380/m382 tmpm380/m382 - 13 / 54 - single boot mode (2-a) using the program in the on-chip boot rom (step -1) the flash block containing the older version of the program code need not be erased before executing the programming routine. since a programming rout ine and programming data are transferred via the sio (sio0), the sio0 must be connected to a host controller. prepare a programming routine (a) on the host controller. (step -2) cancel the reset of the tmpm380/382 by setting the single boot mode pin to ?0?, so that the cpu re-boots from the on-chip boot rom. the 12-byte password transferred from the host controller via sio0 is first compared to the contents of the special flas h memory locations. (if the flash block has already been erased, the password is 0xff). (tmpm380/382) flash memory ram old application program code (or erased state) (host) new application program code (i/o) (a) programming routine boot rom sio0 (tmpm380/382) (host) (i/o) 0 boot new application program code (a) programming routine flash memory ram old application program code (or erased state) boot rom sio0 0 1 reset
23 flash memory operation tmpm380/m382 tmpm380/m382 - 14 / 54 - (step -3) if the password was correct, the boot program downl oads, via the sio0, the programming routine (a) from the host controller into the on-chip ram of the tmpm380/382. the programming routine must be stored in the address range 0x2000 _0400 to the end address of ram. (step -4) the cpu jumps to the programming routine (a) in the on-chip ram to erase the flash block containing the old application program code. the block erase or chip erase command may be used. (tmpm380/382) flash memory ram old application program code (or erased state) (host) new application program code (i/o) (a) programming routine boot rom sio0 (a) programming routine (tmpm380/382) flash memory ram (host) new application program code (i/o) (a) programming routine boot rom sio0 (a) programming routine erased
tmpm380/m382 tmpm380/m382 - 15 / 54 - (step -5) next, the programming routine (a) downloads new app lication program code from the host controller and programs it into the erased flash block. once programming is complete, protection of that flash block is turned on. it is not allowed to move pr ogram control from the programming routine (a) back to the boot rom. in the example below, new program code comes from the same host controller via the same sio0 channel as for the programming routine. howe ver, once the programming routine has begun to execute, it is free to change the transfer path and the source of the transfer. create board hardware and a programming routine to suit your particular needs. (step -6) when programming of the flash memory is comple te, power off the board and disconnect the cable leading from the host to the target board. turn on the power again so that the tmpm380/382 re-boots in single-chip (normal) mode to execute the new program. (tmpm380/382) flash memory ram new application program code (host) new application program code (i/o) (a) p rogramming routine boot rom sio0 (a) programming routine (tmpm380/382) (host) 0 1 reset flash memory ram new application program code boot rom sio0 set to single-chip normal) mode (boot=1)
23 flash memory operation tmpm380/m382 tmpm380/m382 - 16 / 54 - (1) configuration for single boot mode to execute the on-board programming, boot the tmpm380/382 with single boot mode following the configuration shown below. boot (pl0) = 0 reset = 0 1 set the reset input to 0, and set the each boot (pl0) pins to values shown above, and then release reset (high). (2) memory map fig 23-3 shows a comparison of the memory maps in norm al and single boot mode s. in single boot mode, the internal flash memory is mapped from 0x3f80_0000, and the internal boot rom (mask rom) is mapped to 0x0000_0000 through 0x0000_0fff. product name flash size ram size flash address (single chip/ single boot mode) ram address tmpm380fy 256kb 16kb 0x0000_0000 - 0x0003_ffff 0x3f80_0000 - 0x3f83_ffff 0x2000_0000 - 0x2000_3fff tmpm380/382fw 128kb 12kb 0x0000_0000 - 0x0001_ffff 0x3f80_0000 - 0x3f81_ffff 0x2000_0000 - 0x2000_2fff tmpm382fs 64kb 8kb 0x0000_0000 - 0x0000_ffff 0x3f80_0000 - 0x3f80_ffff 0x2000_0000 - 0x2000_1fff
tmpm380/m382 tmpm380/m382 - 17 / 54 - fig 23-3 memory maps for tmpm380fy fig 23-4 memory maps for tmpm380/382fw single chip mode single boot mode 0x0000_0000 internal flash_rom ( 256kb ) 0x0000_0000 0xffff_ffff 0x41ff_f000 0x2000_3fff 0x2000_0000 0x0003_ffff 0x4000_0000 internal i/o internal ram ( 16kb ) 0x41ff_f000 0x2000_0000 0x0000_0fff 0x4000_0000 internal i/o 0xffff_ffff internal flash_rom ( 256kb ) internal ram ( 16kb ) 0x2000_3fff 0x3f80_0000 0x3f83_ffff internal boot_rom ( 4kb ) 0x0000_0000 internal flash_rom ( 128kb ) 0x0000_0000 0xffff_ffff 0x41ff_f000 0x2000_2fff 0x2000_0000 0x0001_ffff 0x4000_0000 internal i/o internal ram ( 12kb ) 0x41ff_f000 0x2000_0000 0x0000_0fff 0x4000_0000 internal i/o 0xffff_ffff internal flash_rom ( 128kb ) internal ram ( 12kb ) 0x2000_2fff 0x3f80_0000 0x3f81_ffff internal boot _ rom ( 4kb ) ifreg area 0x41ff_ffff ifreg area 0x41ff_ffff ifreg area ifreg area 0x41ff_ffff 0x41ff_ffff
23 flash memory operation tmpm380/m382 tmpm380/m382 - 18 / 54 - fig 23-5 memory maps for tmpm382fs 0x0000_0000 internal flash_rom ( 64kb ) 0x0000_0000 0xffff_ffff 0x41ff_f000 0x2000_1fff 0x2000_0000 0x0000_ffff 0x4000_0000 internal i/o internal ram ( 8kb ) 0x41ff_f000 0x2000_0000 0x0000_0fff 0x4000_0000 internal i/o 0xffff_ffff internal flash_rom ( 64kb ) internal ram ( 8kb ) 0x2000_1fff 0x3f80_0000 0x3f80_ffff internal boot_rom ( 4kb ) ifreg area ifreg area 0x41ff_ffff 0x41ff_ffff
tmpm380/m382 tmpm380/m382 - 19 / 54 - (3) interface specification in single boot mode, an sio channel is used for communications with a programming controller. the same configuration is applied to a communication format on a programming controller to execute the on-board programming. both uart (asynchrono us) and i/o interface (synchronous) modes are supported. the communication formats are shown below. ? uart communication communication channel : sio channel 0 serial transfer mode : uart (asynchronous), half -duplex, lsb first data length : 8 bit parity bits : none stop bits : 1 bit baud rate : arbitrary baud rate ? i/o interface mode communication channel : sio channel 0 serial transfer mode : i/o interface mode, full -duplex, lsb first synchronization clock (sclk0) : input mode handshaking signal : pe4 configured as an output mode baud rate : arbitrary baud rate table 23-3 required pin connections interface pins uart i/o interface mode dvdd5 regvdd5 avdd vout3 dvss avss power supply pins cvss mode-setting pin boot (pl0) reset pin reset txd0(pe0) rxd0(pe1) sclk0(pe2) x (input mode) communication pins pe4 x (output mode)
23 flash memory operation tmpm380/m382 tmpm380/m382 - 20 / 54 - (4) data transfer format table 23-4, table 23-6 and table 23-7 illustrate the operation commands and data transfer formats at each operatio n mode. in conjunction with this sect ion, refer to (6) operation of boot program. table 23-4 single boot mode commands code command 0x10 ram transfer 0x20 don?t care 0x30 don?t care 0x40 chip and protection bit erase note : code 0x20 and 0x30 are use for internal test (5) restrictions on internal memories single boot mode places restrictions on the internal ram and rom as shown in table 23-5 . table 23-5 restrictions in single boot mode memory details internal ram boot rom is mapped from 0x2000_0000 to 0x2000_03ff. store the ram transfer program from 0x 2000_0400 through the end address of ram. internal rom the following addresses are assigned for storing software id information and passwords. storing program in these addresses is not recommendable. tmpm380fy tmpm380/382fw tmpm382fs 0x3f83_fff0 to 0x3f83_ffff 0x3f83_fff0 to 0x3f83_ffff 0x3f83_fff0 to 0x3f83_ffff
tmpm380/m382 tmpm380/m382 - 21 / 54 - table 23-6 transfer format for the ram transfer command byte data transferred from the controller to the tmpm380/382 baud rate data transferred from the tmpm380/382 to the controller boot rom 1 byte serial operation mode and baud rate for uart mode 0x86 for i/o interface mode 0x30 desired baud rate (note 1) - 2 byte - ack for the serial operation mode byte for uart mode -normal acknowledge 0x86 (the boot program aborts if the baud rate can not be set correctly.) for i/o interface mode -normal acknowledge 0x30 3 byte command code (0x10) - 4 byte - ack for the command code byte (note 2) -normal acknowledge 0x10 -negative acknowledge 0xn1 -communication error 0xn8 5 byte - 16 byte password sequence (12 bytes) 0x3f83_fff4 to 0x3f83_ffff - 17 byte check sum value for bytes 5 - 16 - 18 byte - ack for the checksum byte (note 2) -normal acknowledge 0xn0 -negative acknowledge 0 n1 -communication error 0 n8 19 byte ram storage start address 31 - 24 - 20 byte ram storage start address 23 - 16 - 21 byte ram storage start address 15 - 8 - 22 byte ram storage start address 7 - 0 - 23 byte ram storage byte count 15 - 8 - 24 byte ram storage byte count 7 - 0 - 25 byte check sum valu e for bytes 19 - 24 - 26 byte - ack for the checksum byte (note 2) -normal acknowledge 0xn0 -negative acknowledge 0xn1 -communication error 0xn8 27 byte m byte ram storage data - m + 1 byte checksum value for bytes 27 - m - m + 2 byte - ack for the checksum byte (note 2) -normal acknowledge 0xn0 -negative acknowledge 0xn1 -communication error 0xn8 ram m + 3 byte - jump to ram storage start address (note 1) in i/o interface mode, the baud rate for the transfers of the first and second bytes must be 1/16 of the desired baud rate. (note 2) in case of any negative acknowledge, the boot program returns to a state in which it waits for a command code (3rd byte). in i/o interface mode, if a communication error occurs, a negative acknowledge does not occur. ?n? in the error code shows an upper 4 bits [7:4] of command code in the 3 rd byte. for example, when a password error occurs in ram transfer command, the ack is ?0x11?. (note 3) the 19th to 25th bytes must be within the ram address range from 0x2000_0400 through the end address of ram.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 22 / 54 - table 23-7 transfer format for the chip and protection bit erase command byte data transferred from the controller to the tmpm380/382 baud rate data transferred from the tmpm380/382 to the controller boot rom 1 byte serial operation mode and baud rate for uart mode 0x86 for i/o interface mode 0x30 desired baud rate (note 1) - 2 byte - ack for the serial operation mode byte for uart mode -normal acknowledge 0x86 for i/o interface mode -normal acknowledge 0x30 (the boot program aborts if the baud rate can not be set correctly.) 3 byte command code (0x40) - 4 byte - ack for the command code byte (note 2) -normal acknowledge 0x40 -negative acknowledge 0xn1 -communication error 0xn8 5 byte chip erase command code (0x54) - 6 byte - ack for the command code byte (note 2) -normal acknowledge 0x54 -negative acknowledge 0xn1 -communication error 0xn8 7 byte - ack for the chip erase command code byte -normal acknowledge 0x4f -negative acknowledge 0x4c 8 byte (wait for the next command code.) - (note 1) in i/o interface mode, the baud rate for the transfers of the first and second bytes must be 1/16 of the desired baud rate. (note 2) in case of any negative acknowledge, the boot program returns to a state in which it waits for a command code (3rd byte). in i/o interface mode, if a communication error occurs, a negative acknowledge does not occur. ?n? in the error code shows an upper 4 bits [7:4] of command code in the 3 rd byte. for example, when a password error occurs in chip and protection bit erase command, the ack is ?0x41?.
tmpm380/m382 tmpm380/m382 - 23 / 54 - (6) operation of boot program when single boot mode is selected, the boot prog ram is automatically exec uted on startup. the boot program offers these two commands, of wh ich the details are provided on the following subsections. the addresses described in this section are the virtual unless otherwise noted. 1. ram transfer command the ram transfer command stores program code transferred from a host controller to the on-chip ram and executes the pr ogram once the transfer is successfully completed. the user program ram space can be assigned to the range from 0x2000_0400 to the end address of ram, whereas the boot program area (0x2000_0000 to 0x2000_03ff) is unavailable. the user program starts at the assigned ram address. the ram transfer command can be used to download a flash programming routine of your own; this provides the ability to control on-board programming of the flash memory in a unique manner. the programming routine must utilize the flash memory command sequences described in section20.3. before initiating a transfer, the ram transfer command verifies a password sequence coming from the controller against that stored in the flash memory. 2. chip and protection bit erase command this command erases the entire area of the fl ash memory automatically without verifying a password. all the blocks in the memory cell and their protection conditions are erased even when any of the blocks are prohibited from writing and erasing. when the command is completed, the secbit bit is set to ?1?. this command serves to recover boot programming operation when a user forgets the password. therefore password verification is not executed.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 24 / 54 - 1) ram transfer command (see table 23-6) 1. the 1st byte specifies wh ich one of the two serial operation modes is used. for a detailed description of how the serial operation mode is determined, see determination of a serial operation mode described later. if it is determined as uart mode, the boot program then checks if the sio0 is programmable to the baud rate at which the 1st byte was transferred. during t he first-byte interval, the rxe bit in the sc0mod0 register is cleared. ? to communicate in uart mode send, from the controller to the target board, 86h in uart data format at the desired baud rate. if the serial operation mode is determined as uart, then the boot program checks if the sio0 can be programmed to the baud rate at which the first byte was transferred. if that baud rate is not possible, t he boot program aborts, disabling any subsequent communications. ? to communicate in i/o interface mode send, from the controller to the target boar d, 0x30 in i/o interface data format at 1/16 of the desired baud rate. also send the 2nd byte at the same baud rate. then send all subsequent bytes at a rate equal to the desired baud rate. in i/o interface mode, the cpu sees the se rial receive pin as if it were a general input port in monitoring its logic transition s. if the baud rate of the incoming data is high or the chip?s operating frequency is high, the cpu may not be able to keep up with the speed of logic transitions. to prevent such situations, the 1st and 2nd bytes must be transferred at 1/16 of the desired baud rate; then the boot program calculates 16 times that as the desired baud rate. when the serial operation mode is determined as i/o interface mode, the sio0 is configured for sclk input mode. beginning with the third byte, the contro ller must ensure that its ac timing restrictions are satisfied at the select ed baud rate. in the case of i/o interface mode, the boot program does not check t he receive error flag; thus there is no such thing as error acknowledge (bit 3, 0xn8). 2. the 2nd byte, transmitted from the target board to the controller, is an acknowledge response to the 1st byte. the boot program echoes back the first byte: 0x86 for uart mode and 0x30 for i/o interface mode. uart mode if the sio0 can be programmed to the baud rate at which the 1st byte was transferred, the boot program programs the sc0brcr and se nds back 0x86 to the controller as an acknowledge. if the sio0 is not progra mmable at that baud rate, the boot program simply aborts with no error indication. follow ing the 1st byte, the controller should allow for a time-out period of five seconds. if it does not receive 0x86 within the allowed time-out period, the controller should gi ve up the communication. the boot program sets the rxe bit in the sc0mod0 register to enable reception (1) before loading the sio transmit buffer with 0x86. ? i/o interface mode the boot program programs the sc0mod0 and sc0cr registers to configure the sio0 in i/o interface mode (clocked by the rising edge of sclk0), writes 0x30 to
tmpm380/m382 tmpm380/m382 - 25 / 54 - the sc0buf. then, the sio0 waits for the sclk0 signal to come from the controller. following the transmission of t he 1st byte, the controller should send the sclk clock to the target board after a certain idle time (several microseconds). this must be done at 1/16 the desire baud rate. if the 2nd byte, which is from the target board to the controller, is 0x30, then the controller should take it as a go-ahead. the controller must then deliver the 3rd byte to the target board at a rate equal to the desired baud rate. the boot program sets the rxe bit in the sc0mod register to enable reception before loading the sio transmit buffer with 0x30. 3. the 3rd byte transmitted from the contro ller to the target board is a command. the code for the ram transfer command is 0x10. 4. the 4th byte, transmitted from the target board to the controller, is an acknowledge response to the 3rd byte. before sending back the acknowledge response, the boot program checks for a receive error. if there was a receive error, the boot program transmits x8h (bit 3) and returns to the stat e in which it waits for a command (the third byte) again. in this case, the upper four bits of the acknowledge response are undefined - they hold the same values as the upper four bits of the previously issued command. when the sio0 is configured for i/o interface mode, the boot program does not check for a receive error. if the 3rd byte is equal to any of the command codes listed in table 23-4, the boot pro gra m ech oes it back to the controller. when the ram transfer command was received, the boot program echoes back a value of 0x10 and then branches to the ram transfer routine. once this branch is taken, password verification is done. password verification is detailed in a later section ?password?. if the 3rd byte is not a valid command, the boot program sends back 0xn1 (bit 0) to the controller and returns to the state in which it waits for a command (the third byte) again. in this case, the upper four bits of the acknowledge respon se are undefined - they hold the same values as the upper four bits of the previously issued command. 5. the 5th to 16th bytes transmitted from the controller to the target board, are a 12-byte password. each byte is compared to the c ontents of following addresses in the flash memory. the verification is started with the 5 th byte and the smallest address in the designated area. if the password verification fails, the ram transfer routine sets the password error flag. product name area tmpm380fy tmpm380/382fw tmpm382fs 0x3f83_fff4 ? 0x3f83_ffff 6. the 17th byte is a checksum value for the password sequence (5th to 16th bytes). to calculate the checksum value for the 12 -byte password, add the 12 bytes together, drop the carries and take the two?s complement of the total sum. transmit this checksum value from the controller to the target board. the checksum calculation is described in details in a later section ?checksum calculation?. 7. the 18th byte, transmitted from the target board to the controller, is an acknowledge
23 flash memory operation tmpm380/m382 tmpm380/m382 - 26 / 54 - response to the 5th to 17th bytes. first, t he ram transfer routine checks for a receive error in the 5th to 17th bytes. if there was a receive error, the boot program sends back 18h (bit 3) and returns to the state in which it waits for a command (i.e., the 3rd byte) again. in this case, the upper four bits of the acknowledge response are the same as those of the previously issued command (i.e., all 1s). when the sio0 is configured for i/o interface mode, the ram transfer rout ine does not check for a receive error. next, the ram transfer rout ine performs the checksum operation to ensure data integrity. adding the series of the 5th to 16t h bytes must result in 0x00 (with the carry dropped). if it is not 0x00, one or more bytes of data has been corrupted. in case of a checksum error, the ram transfer routi ne sends back 0x11 to the controller and returns to the state in which it waits for a command (i.e., the 3rd byte) again. finally, the ram transfer routine examines t he result of the password verification. the following two cases are treated as a password error. in these cases, the ram transfer routine sends back 0x11 (bit 0) to the controlle r and returns to the state in which it waits for a command (i.e., the 3rd byte) again. ? irrespective of the result of the pas sword comparison, all the 12 bytes of a password in the flash memory are the same value other than 0xff. not the entire password bytes transmitted fr om the controller matched those contained in the flash memory. when all the above verification has been successful, the ram transfer routine returns a normal acknowledge response (0x10) to the controller. 8. the 19th to 22nd bytes, transmitted from t he controller the target board, indicate the start address of the ram region where su bsequent data (e.g., a flash programming routine) should be stored. the 19th byte co rresponds to bits 31?24 of the address and the 22nd byte corresponds to bits 7?0 of the address. 9. the 23rd and 24th bytes, transmitted from the controller to the target board, indicate the number of bytes that will be transferred from the controller to be stored in the ram. the 23rd byte corresponds to bits 15?8 of the number of bytes to be transferred, and the 24th byte corresponds to bits 7?0 of the number of bytes. 10. the 25th byte is a checksum value fo r the 19th to 24th bytes. to calculate the checksum value, add all these bytes togethe r, drop the carries and take the two?s complement of the total sum. transmit this checksum value from the controller to the target board. the checksum calculation is described in details in a later section ?checksum calculation?. 11. the 26th byte, transmitted from the target board to the controller, is an acknowledge response to the 19th to 25th bytes of data. first, the ram transfer routine checks for a receive error in the 19th to 25th bytes. if t here was a receive error, the ram transfer routine sends back 0x18 and returns to t he command wait state (i.e., the 3rd byte) again. in this case, the upper four bits of the acknowledge response are the same as those of the previously issued command (i.e., all 1s). when the sio0 is configured for i/o interface mode, the ram transfer rout ine does not check for a receive error.
tmpm380/m382 tmpm380/m382 - 27 / 54 - next, the ram transfer routine performs the checksum operation to ensure data integrity. adding the series of the 19th to 25th bytes must result in 00h (with the carry dropped). if it is not 00h, one or more by tes of data has been corrupted. in case of a checksum error, the ram transfer routi ne sends back 0x11 to the controller and returns to the state in which it waits for a command (i.e., the 3rd byte) again. ? the ram storage start address must be within the range of 0x2000_0400 to the end address of ram. when the above checks have been successful , the ram transfer routine returns a normal acknowledge response (0x10) to the controller. 12. the 27th to mth bytes from the contro ller are stored in the on-chip ram of the tmpm380/382. storage begins at the addres s specified by the 19th?22nd bytes and continues for the number of bytes specified by the 23rd?24th bytes. 13. the (m+1) th byte is a checksum value. to calculate the checksum value, add the 27th to mth bytes together, drop the carries and ta ke the two?s complement of the total sum. transmit this checksum value from the controller to the target board. the checksum calculation is described in details in a later section ?checksum calculation?. 14. the (m+2) th byte is a acknowledge re sponse to the 27th to (m+1) th bytes. first, the ram transfer routine checks for a receive error in the 27th to (m+1) th bytes. if there was a receive error, the ram tran sfer routine sends back 18h (bit 3) and returns to the state in which it waits for a command (i.e., the 3rd byte) again. in this case, the upper four bits of the acknowledge response are the same as those of the previously issued command (i.e., all 1s). when the sio0 is configured for i/o interface mode, the ram transfer routine does not check for a receive error. next, the ram transfer rout ine performs the checksum operation to ensure data integrity. adding the series of the 27th to (m +1) th bytes must result in 0x00 (with the carry dropped). if it is not 0x00, one or more bytes of data has been corrupted. in case of a checksum error, the ram transfer routi ne sends back 0x11 (bit 0) to the controller and returns to the command wait state (i .e., the 3rd byte) again. when the above checks have been successful, the ram transfer routine returns a normal acknowledge response (0x10) to the controller. 15. if the (m+2) th byte was a normal acknowledge response, a branch is made to the address specified by the 19th to 22nd bytes.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 28 / 54 - 2) chip and protection bit erase command (see table 23-7) 1. the processing of the 1st and 2nd bytes ar e the same as for the ram transfer command. 2. the 3rd byte, which the target board receives from the controller, is a command. the code for the show product information command is 0x40. 3. the 4th byte, transmitted from the target board to the controller, is an acknowledge response to the 3rd byte. before sending back the acknowledge response, the boot program checks for a receive error. if there was a receive error, the boot program transmits x8h (bit 3) and returns to the command wait state again. in this case, the upper four bits of the acknowledge respon se are undefined - they hold the same values as the upper four bits of the previously issued command. if the 3rd byte is equal to any of the command codes listed in table 23-4 , the boot program echoes it back to the controller. when the show flash memory sum command was received, the boot program echoes back a value of 0x40. if the 3rd byte is not a valid command, the boot program send s back 0xn1 (bit 0) to the controller and returns to the state in which it waits for a command (the third byte) again. in this case, the upper four bits of the acknowledge re sponse are undefined - they hold the same values as the upper four bits of the previously issued command. 4. the 5th byte, transmitted from the target boar d to the controller, is the chip erase enable command code (0x54). 5. the 6th byte, transmitted from the target board to the controller, is an acknowledge response to the 5th byte. before sending back the acknowledge response, the boot program checks for a receive error. if there was a receive error, the boot program transmits 0xn8 (bit 3) and returns to the command wait state again. in this case, the upper four bits of the acknowledge response are undefined - they hol d the same values as the upper four bits of the previously issued command. if the 5th byte is equal to any of the command codes to enable erasing, the boot program echoes it back to the controller. when the show flash memory sum command was received, the boot program echoes back a value of 0x54 and then branches to the chip erase routine. if t he 5th byte is not a valid command, the boot program sends back 0xn1 (bit 0) to the controller and returns to the state in which it waits for a command (the third byte) again. in this case, the upper four bits of the acknowledge response are undefined - they hol d the same values as the upper four bits of the previously issued command.
tmpm380/m382 tmpm380/m382 - 29 / 54 - 6. the 7 th byte indicates whether the chip erase command is normally completed or not. at normal completion, comple tion code (0x4f) is sent. when an error was detected, error code (0x4c) is sent. 7. the 9th byte is the next command code.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 30 / 54 - 5) acknowledge responses the boot program represents processing states with specific codes. table 23-8 to table 23-11 show the values of possible ackno w ledge responses to t he received data. the upper four bits of the acknowledge response are equal to those of the co mmand being executed. bit 3 of the code indicates a receive error. bit 0 indicates an invalid command error, a checksum error or a password error. bit 1 and bit 2 are always 0. receive error ch ecking is not done in i/o interface mode. table 23-8 ack response to the serial operation mode byte return value meaning 0x86 the sio can be configured to operate in uart mode. (see note) 0x30 the sio can be configured to operate in i/o interface mode. (note) if the serial operation mode is determined as uart, the boot program checks if the sio can be programmed to the baud rate at which the operation mode byte was transferred. if that baud rate is not possible, the boot program aborts, without sending back any response. table 23-9 ack response to the command byte return value meaning 0xn8 (see note) a receive error occurred while getting a command code. 0xn1 (see note) an undefined command code was received. (reception was completed normally.) 0x10 the ram transfer command was received. 0x20 command was received. 0x30 command was received. 0x40 the chip erase command was received. (note1) the upper four bits of the ack response are the same as those of the previous command code. (note2) command 0x20 and 0x30 are use for internal test only. table 23-10 ack response to the checksum byte return value meaning 0xn8 (see note) a receive error occurred. 0xn1 (see note) a checksum or password error occurred. 0xn0 (see note) the checksum was correct. (note) the upper four bits of the ack response are the same as those of the operation command code. it is 1 ( n ram transfer command data [7:4] ) when password error occurs. table 23-11 ack response to chip and protection bit erase byte return value meaning 0x54 the chip erase enabling command was received. 0x4f the chip erase command was completed. 0x4c the chip erase command was abnormally completed.
tmpm380/m382 tmpm380/m382 - 31 / 54 - 6) determination of a serial operation mode the first byte from the controller determines t he serial operation mode. to use uart mode for communications between the controller and the target boar d, the controller must first send a value of 0x86 at a desired baud rate to the target board. to use i/o interface mode, the controller must send a value of 0x30 at 1/16 the desired baud rate. fig 23-6 shows the waveforms for the first byte. fig 23-6 serial operation mode byte after reset is released, the boot program monitors the firs t serial byte from the controller, with the sio reception disabled, and calculates the intervals of tab, tac and tad. table 23-5 shows a flowchart describing the steps to det ermine the intervals of t ab, tac and tad. as shown in the flowchart, the boot program captures timer counts each time a logic tran sition occurs in the first serial byte. consequently, the calculated tab, tac and tad inte rvals are bound to have slight errors. if the transfer goes at a high baud rate, the cpu might not be able to keep up with the speed of logic transitions at the serial receive pin. in particular, i/o interface mode is more pron e to this problem since its baud rate is generally much higher than that for uart mode. to avoid such a situation, the controller should send the first serial byte at 1/16 the desired baud rate. the flowchart in table 23-5 shows how the boot program distinguishes between uart and i/o interface modes. if the le ngth of tab is equal to or less than the length of tcd, the serial operation mode is determined as uart mode. if the length of t ab is greater than the length of tcd, the serial operation mode is determined as i/o interface mode. bear in mind that if the baud rate is too high or the timer operating frequency is t oo low, the timer resolution will be co arse, relative to the intervals between logic transitions. this becomes a problem due to inherent errors caused by the way in which timer counts are captured by software; consequent ly the boot program might not be able to determine the serial operation mode correctly. to prevent this problem, reset uart mode within the programming routine. for example, the serial operation mode may be determined to be i/o interface mode when the intended mode is uart mode. to avoid such a si tuation, when uart mode is utilized, the controller should allow for a time-out period within which it expects to receive an echo-back (0x86) from the target board. the controller should give up the communica tion if it fails to get that echo-back within the allowed time. when i/o interface mode is utilized, onc e the first serial byte has been transmitted, the controller should send the sclk clock after a certain idle time to get an acknowledge response. if the received acknowledge response is not 0x30, the controller should give up further communications. uart (0x86) i/o interface (0x30) tab tab a b c d a b c d bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 start stop tcd tcd t a c t a d t a c t a d
23 flash memory operation tmpm380/m382 tmpm380/m382 - 32 / 54 - when the intended mode is i/o interface mode, the firs t byte does not have to be 0x30 as long as tab is greater than tcd as shown above. 0x91, 0xa1 or 0xb1 can be sent as the first byte code to determine the falling edges of point a and point c and the rising edges of point b and point d. if tab is greater than tcd and sio is selected by the resolution of the operation mode determination, the second byte code is 0x30 even though the transmitted code on the first byte is not 0x30 (the first byte code to determine i/o interface mode is described as 0x30). fig 23-7 serial operation mode byte reception flow initialize tmrb0 prescaler is on. (source clock: t1 ) tmrb0 starts counting up point a stop operation (infinite loop) high-to-low transition on serial receive pin? yes yes yes start low-to-high transition on serial receive pin? software-capture and save timer value (tab) low-to-high transition on serial receive pin? software-capture and save timer value (tac) yes low-to-high transition on serial receive pin? software-capture and save timer value (tad) 16-bit timer 0 stops counting tac tad? make backup copy of tad value done yes point b point c point d
tmpm380/m382 tmpm380/m382 - 33 / 54 - fig 23-8 serial operation mode determination flow 7) password the ram transfer command (0x10) causes the boot pr ogram to perform password verification. following an echo-back of the command code, the boot program ve rifies the contents of the 12-byte password area within the flash memory. the following table shows the password area. product name area tmpm380fy tmpm380/382fw tmpm382fs 0x3f83_fff4 ? 0x3f83_ffff if all these address locations contain the same bytes of data other than 0xff, a pass word area error occurs as shown in fig 23-9. in this case, the boot program return s an error a c knowledge (0x11) in response to the checksum byte (the 17th byte), regardless of wh ether the password sequence sent from the controller is all 0xffs. the password sequence received from the controller (5th to 16th bytes) is compared to the password stored in the flash memory. all of the 12 bytes must match to pass the password verification. otherwise, a password error occurs, which causes the boot program to reply an error acknowledge in response to the checksum byte (the 17th byte). the password verification is performed ev en if the security function is enabled. tcd tad ? tac tab > tcd? start yes uart mode i/o interface mode
23 flash memory operation tmpm380/m382 tmpm380/m382 - 34 / 54 - fig 23-9 password area verification flow 8) checksum calculation the checksum byte for a series of bytes of data is calculated by adding t he bytes together, dropping the carries, and taking the two?s complement of the total sum. the controller must perform the same checksum operation in transmitting checksum bytes. example) assume the upper and lower bytes of the sum as 0xe5 and 0xf6. to calculate the checksum for a series of 0xe5 and 0xf6: add the bytes together 0xe5 + 0xf6 = 0x1db take the two?s complement of the su m, and that is the checksum byte. 0 ? 0xdb = 0x25 start yes yes are all bytes equal to 0xff? password area error are all bytes the same? password area is normal.
tmpm380/m382 tmpm380/m382 - 35 / 54 - (7) general boot program flowchart fig 23-10 shows an overall flowchart of the boot program. fig 23-10 overall boot pro g ram fl ow initialize i/o interface single boot program starts get sio operation mode sio operation mode? set i/o interface mode ack data received data ( 0x30 ) (send 0x30) normal res p onse prepare to get a command receive routine get a command ack data ack data & 0xf0 no normally receive error ? ram transfer? ack data received data ( 0x10 ) transmission routine ( send 0 x 10: normal response ) yes (0x10) ram transfer processing processed normally? jump to ram yes normall y baud rate settin g ? program uart mode and baud rate ack data received data ( 0x86 @ uart ) (send 0x86) normal res p onse ack data ack data 0x08 stop operation uart cannot be set transmission routine ( send0xn8:receive erro r ) command error ack data received data ( 0 x 40 ) transmission routine ( send 0x40: normal response ) yes can be set ack data received data | 0x01 transmission routine ( send 0xn1: command chip erase? chip erase processing yes (0x40)
23 flash memory operation tmpm380/m382 tmpm380/m382 - 36 / 54 - 23.3 on-board programming of flas h memory (rewrite/erase) in on-board programming, the cpu is to execute so ftware commands for rewriting or erasing the flash memory. the rewrite/erase control program should be prepared by the user beforehand. because the flash memory content cannot be read while it is being written or erased, it is necessary to run the rewrite/erase program from the intern al ram or from an external memory device after shifting to the user boot mode. 23.3.1 flash memory except for some functions, writing and erasing flash memory data are in accordance with the standard jedec commands. in writing or erasi ng, use 32-bit data transfer command of the cpu to enter commands to the flash memory. once the co mmand is entered, the actual write or erase operation is automatically performed internally. table 23-12 flash memory functions major functions description automatic page program writes data automatically per page. automatic chip erase erases the entire area of the flash memory automatically. automatic block erase erases a selected block automatically. protect function by writing a 4-bit pr otection code, the write or erase f unction can be individually inhibited for each block. note that addressing of operation commands is different from the case of standard commands due to the specific interface arrangements with t he cpu. also note that the flash memo ry is written in 32-bit blocks. so, 32-bit (word) data transfer commands must be used in writing the flash memory. (1) block configuration fig 23-11 block configuration of flash memory (tmpm380fy) 0x3f80_0000 0x3f80_4000 0x3f80_8000 0x3f81_0000 0x0000_0000 0x0000_4000 0x0001_8000 0x0001_0000 0x3f82_0000 0x3f83_0000 0x0002_0000 0x0003_0000 0x3f83_ffff 0x0003_ffff single boot mode user boot mode page configuration 64k bytes (block0) 64k bytes (block1) 64k bytes (block2) 32k bytes (block3) 16k bytes (block5) 16k bytes (block4) 64 words x 256 64 words x 256 64 words x 256 64 words x 128 64 words x 64 64 words x 64
tmpm380/m382 tmpm380/m382 - 37 / 54 - fig 23-12 block configuration of flash memory (tmpm380/382fw) 0x3f81_ffff 0x0001_ffff 0x3f80_0000 0x3f80_4000 0x3f80_8000 0x3f81_0000 0x0000_0000 0x0000_4000 0x0001_8000 0x0001_0000 0x3f82_0000 0x3f83_0000 0x0002_0000 0x0003_0000 0x3f83_ffff 0x0003_ffff single boot mode user boot mode page configuration 64k bytes (block0) 64k bytes (block1) 64k bytes (block2) 32k bytes (block3) 16k bytes (block5) 16k bytes (block4) 64 words x 256 64 words x 128 64 words x 64 64 words x 64 64 word ? x 1 0x3f83_ff00 0x0003_ff00 (note) in addition to 128kb flash area, the tmpm380fw/382fw provides 64-word data/password area (0x3f83_ff00 . 0x3f83_ffff, 1 page) for show product information command. to erase the content, execute the automatic chip erase command or assign block 0 with the automatic block erase command.software reset becomes ineffective in bus write cycles on and after the fourth bus write cycle of the automatic page programming command. ?
23 flash memory operation tmpm380/m382 tmpm380/m382 - 38 / 54 - fig 23-13 block configuration of flash memory (tmpm382fs) 0x3f80_ffff 0x0000_ffff 0x3f80_0000 0x3f80_4000 0x3f80_8000 0x3f81_0000 0x0000_0000 0x0000_4000 0x0001_8000 0x0001_0000 0x3f82_0000 0x3f83_0000 0x0002_0000 0x0003_0000 0x3f83_ffff 0x0003_ffff single boot mode user boot mode page configuration 64k bytes (block0) 64k bytes (block1) 64k bytes (block2) 32k bytes (block3) 16k bytes (block5) 16k bytes (block4) 64 words x 128 64 words x 64 64 words x 64 64 word ? x 1 0x3f83_ff00 0x0003_ff00 (note) in addition to 64kb flash area, the tmpm382fs provides 64-word data/password area (0x3f83_ff00 . 0x3f83_ffff, 1 page) for show product information command. to erase the content, execute the automatic ch ip erase command or assign block 0 with the automatic block erase command.software reset becomes ineffective in bus write cycles on and after the fourth bus write cycle of the automatic page programming command. ?
tmpm380/m382 tmpm380/m382 - 39 / 54 - (2) basic operation generally speaking, this flash memory device has the following two operation modes: ? the mode to read memory data (read mode) ? the mode to automatically erase or re write memory data (automatic operation) transition to the automatic mode is made by ex ecuting a command sequence while it is in the memory read mode. in the automatic operat ion mode, flash memory data cannot be read and any commands stored in the flas h memory cannot be executed. in the automatic operation mode, any interrupt or exception generation c annot set the device to the read mode except when a hardware reset is generated. during aut omatic operation, be sure not to cause any exceptions other than debug exceptions and reset while a debug port is connected. any exception generation cannot set the device to the read mode except when a hardware reset is generated. 1) read when data is to be read, the flash memory must be set to the read mode. the flash memory will be set to the read mode immediately after power is applied, when cpu reset is removed, or when an automatic operation is normally term inated. in order to return to the read mode from other modes or after an automatic opera tion has been abnormally terminated, either the read/reset command (a software command to be described later) or a hardware reset is used. the device must also be in the read mode when any command written on the flash memory is to be executed. ? read/reset command and read command (software reset) when id-read command is used, the read ing operation is terminated instead of automatically returning to the read mode. in this case, the read/reset command can be used to return the flash memory to the read mode. also, when a command that has not been completely written has to be canceled, t he read/reset command must be used. the read command is used to return to the read mode after executing 32-bit data transfer command to write the data "0x0000_00f0" to an arbitrary address of the flash memory. ? with the read/reset command, the device is returned to the read mode after completing the third bus write cycle. 2) command write this flash memory uses the command c ontrol method. commands are executed by executing a command sequence to the flash memory. the flash memory executes automatic operation commands according to the address and data combinations applied (refer to command sequence). if it is desired to cancel a command write operation already in progress or when any incorrect command sequence has been entered, the read/reset command is to be executed. then, the flash memory will termin ate the command execution and return to the read while commands are generally comprised of seve ral bus cycles, the operation to apply 32-bit data transmit command to the flash memory is calle d "bus write cycle." t he bus write cycles are to be in a specific sequential order and the flash memory will perform an automatic operation when the sequence of the bus write cycle data and address of a command write operation is in accordance with a predefined specific sequen ce. if any bus write cycle does not follow a
23 flash memory operation tmpm380/m382 tmpm380/m382 - 40 / 54 - predefined command write sequence, the flash memory will terminate the command execution and return to the read mode. (note 1) command sequences are executed from outside the flash memory area. (note 2) each bus write cycle must be sequentially executed by 32-bit data transmit command. while a command sequence is being executed, access to the flash memory is prohibited. also, don't generate any interrupt (except debug exceptions when a dsu probe is connected).if such an operation is made, it can result in an unexpected read access to the flash memory and the command sequencer may not be able to correctly recognize the command. while it could cause an abnormal termination of the command sequence, it is also possible that the written command is incorrectly recognized. (note 3) for the command sequencer to recognize a command, the device must be in the read mode prior to executing the command. be sure to check before the first bus write cycle that the flcs rdy/bsy bit is set to "1." it is recommended to subsequently execute a read command. (note 4) upon issuing a command, if any address or data is incorrectly written, be sure to perform a software reset to return to the read mode again. (3) reset hardware reset a hardware reset is used to cancel the operational mode set by the command write operation when forcibly termination during auto programming/ erasing or abnormal termination during auto operations occurs. the flash memory has a reset input as the memory block and it is conne cted to the cpu reset signal. therefore, when the reset input pin of this device is set to v il or when the cpu is reset due to any overflow of the watch dog timer, the flash memory will return to the read mode terminating any automatic operation that may be in progress. it should al so be noted that applying a hardware reset during an automatic operation can result in incorrect rewriting of data. in such a case, be sure to perform the rewriting again. refer to section 23.2.1 "reset operation" for cpu re set ope rations. af ter a given reset input, the cpu will read the reset vector data from the flash memory and starts operation after the reset is removed.
tmpm380/m382 tmpm380/m382 - 41 / 54 - (4) commands 1) automatic page programming writing to a flash memory device is to make "1" data cells to "0" data cells. any "0" data cell cannot be changed to a "1" data cell. for making "0" data cells to "1" data cells, it is necessary to perform an erase operation. the automatic page programming function of this device writes data of each page. the tmpm380/382 contains 64 words in a page. a 64 word block is defined by a same [31:8] address and it starts from the address [7:0] = 0 and ends at the address [7:0] = 0xff. this programming unit is hereafter referred to as a "page." writing to data cells is automatically performed by an internal sequencer and no external control by the cpu is required. the state of automatic page programming (whether it is in writing operation or not) can be checked by the flcs [0] register. also, any new command sequence is not acc epted while it is in the automatic page programming mode. if it is desired to interrupt the automatic page programming, use the hardware reset function. if the operation is st opped by a hardware reset operation, it is necessary to once erase the page and then perform the automatic page programming again because writing to the page has not been normally terminated. the automatic page programming operation is allowed only once for a page already erased. no programming can be performed twice or more times irrespective of the data cell value whether it is "1" or "0." note that rewritin g to a page that has been once written requires execution of the automatic block erase or automatic chip erase command before executing the automatic page programming command again. note that an attempt to rewrite a page two or more times without erasing the c ontent can cause damages to the device. no automatic verify operation is performed inter nally to the device. so, be sure to read the data programmed to confirm that it has been correctly written. the automatic page programming operation star ts when the third bus write cycle of the command cycle is completed. on and after the fifth bus write cycle, data will be written sequentially starting from the next address of t he address specified in the fourth bus write cycle (in the fourth bus write cycle, the page top address w ill be command written) (32 bits of data is input at a time). be sure to us e the 32-bit data transfer command in writing commands on and after the fourth bus cycle. in this, any 32-bit data transfer commands shall not be placed across word boundary. on and after the fifth bus write cycle, data is command written to the same page area. even if it is desired to write the page only partially, it is required to perform the automatic page programming for the entire page. in this case, the address input for the fourth bus write cycle shall be set to the top address of the page. be sure to perform command write operation with the input data set to "1" for the data cells not to be set to "0." for example, if the top address of a page is not to be written, set the input data of the fourth bus write cycl e to 0xffffffff to command write the data. once the fourth bus cycle is executed, it is in the automatic programming operation. this condition can be checked by monitoring the register bit flcs [0] (see table 23-13). any n e w command sequence is not ac cepted while it is in automatic page programming mode. if it is desired to stop operation, use the hardware reset function. be careful in doing so because data cannot be wri tten normally if the oper ation is interrupted.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 42 / 54 - when a single page has been command written normally terminating the automatic page writing process, the flcs [0] bit is set to "1" and it returns to the read mode. when multiple pages are to be written, it is necessary to execute the page programming command for each page because the number of pages to be written by a single execution of the automatic page program command is lim ited to only one page. it is not allowed for automatic page programming to process input data across pages. data cannot be written to a protected block. when automatic programming is finished, it automatically returns to the read mode. this condition can be checked by monitoring flcs [0] ( table 23-13). if automatic programming has failed, the flash memory is locked in the mode and will not return to the read mod e . for returning to the read mode, it is necessary to execute hardware reset to reset t he flash memory or the device. in this case, while writing to the address has failed, it is recommended not to use the device or not to use the block that includes the failed address. 2) automatic chip erase the automatic chip erase operation starts wh en the sixth bus write cycle of the command cycle is completed. this condition can be checked by monitoring flcs [0] (see table 23-13). while no au to matic verify operation is performed internally to the device, be sure to read the data to confirm that data has been correctly erased. any new command sequence is not accepted while it is in an automatic chip erase operation. if it is desired to stop operation, use the hardware reset function. if the operation is forced to stop, it is necessary to perform the automatic chip erase o peration again because the data erasing operation has not been normally terminated. also, any protected blocks cannot be erased. if all the blocks are protected, the automatic chip erase operation will not be performed and it returns to the read mode after completing the sixth bus read cycle of the command sequence. when an automatic chip erase operation is normally terminated, it automatically returns to the read mode. if an automatic chip erase operatio n has failed, the flash memory is locked in the mo de and will not return to the read mode. for returning to the read mode, it is necessary to execute hardware reset to reset the device. in this case, the failed block cannot be detected. it is recommended not to use the device anymore or to identify the failed block by usi ng the block erase function for not to use the identified block anymore. 3) automatic block erase (fro aech block) the automatic block erase operation starts when the sixth bus write cycle of the command cycle is completed. this status of the automatic block erase operation can be checked by monitoring flcs (see table 23-13). while no automatic verify operation is performed internally to the device, be sure to re ad the d ata to c onfirm that data has been correctly erased. any new command sequence is not accepted while it is in an automatic block erase operation. if it is desired to stop operation, use the hardware reset function. in this case, it is necessary to perform the automatic block erase operation again because the data erasing operation (note) software reset becomes ineffective in bus write cycles on and after the fourth bus write cycle of the automatic page programming command. ? ?
tmpm380/m382 tmpm380/m382 - 43 / 54 - has not been normally terminated. also, any protected blocks cannot be erased. if an automatic block erase operation has failed, the flash memory is locked in the mode and will not return to the read mode. in this case, execute hardware rese t to reset the device. 4) automatic programming of protection bits (for each block) this device is implemented with protection bits. this protection can be set for each block. see table 23-18 for table of protection bit addresses. this devi c e assigns 1 bit to 1 block as a protection bit. the applicable protection bit is specified by pba in the seventh bus write cycle. by automatically progra mming the protection bits, write and/or erase functions can be inhibited (for protection) individually for each block. the protection st atus of each block can be checked by the flcs register to be described later. this status of the automatic programming operation to set protection bits can be checked by monitoring flcs (see table 23-13). any new command sequence is not accepted while automati c pro gramming is in progress to prog ram the protection bits. if it is desired to stop the programming operation, use the hardware reset function. in this case, it is necessary to perform the programming operation again because the protection bits may not have been correctly programmed. if all the protection bits have been programmed, all the flcs bits are set to "1" indicating that it is in the protected state (see table 23-13 ). this disables subsequent writing and erasing of all blocks. (note) software reset is ineffective in the seventh bus write cycle of the automatic protection bit programming command. the flcs bit turns to "0" after entering the seventh bus write cycle. ?
23 flash memory operation tmpm380/m382 tmpm380/m382 - 44 / 54 - 5) automatic erasing of protection bits different results will be obtained when the automatic protection bit erase command is executed depending on the status of the protection bits and the security bits. it depends on the status of flcs whether all t he bits are set to "1" or not if secbit is 0x1. be sure to check the value of flcs before executing the automatic protection bit erase command. see chapter 17 for details. ? when all the flcs bits are set to "1" (all the protection bits are programmed): when the automatic protection bit erase command is command written, the flash memory is automatically initialized within the device. wh en the seventh bus writ e cycle is completed, the entire area of the flash me mory data cells is erased and then the protection bits are erased. this operation can be checked by monitoring flcs . if the automatic operation to erase protection bits is normally terminated, flcs will be set to "0x00000001." while no automatic verify operation is performed internally to the device, be sure to read the data to confirm that it has been correctly eras ed. for returning to the read mode while the automatic operation after the seventh bus cycle is in progress, it is necessary to use the hardware reset to reset the device. if this is don e, it is necessary to check the status of protection bits by flcs after retuni ng to the read mode and perform either the automatic protection bit erase, automatic chip erase, or automatic bl ock erase operation, as appropriate. ? when the flcs bits include "0" (not all the protection bits are programmed): the protection condition can be canceled by t he automatic protection bit erase operation. with this device, protection bits set by an individual block can be erased handling all the blocks at a time as shown in table 23-19. the target bits are specified in the seventh bus write cycl e an d when the comman d is completed, the device is in a condition all the blocks are erased. the protection status of each bloc k can be checked by flcs to be described later. this status of the progra mming operation for automatic protection bits can be checked by monitoring flcs . when the automatic operation to erase protection bits is normally terminated, the prot ection bits of flcs selected for erasure are set to "0." in any case, any new command sequence is not accepted while it is in an automatic operation to erase protection bits. if it is desired to stop the operation, use the hardware reset function. when the automatic operation to erase protection bits is normally terminated, it returns to the read mode. (note) the flcs bit is "0" while in automatic operation and it turns to "1" when the automatic o p eration is terminated.
tmpm380/m382 tmpm380/m382 - 45 / 54 - 6) id-read using the id-read command, you can obtain the type and other information on the flash memory contained in the device. the data to be loaded will be different depending on the address [15:14] of the fourth and subsequent bus write cycles (recommended input data is 0x00). on and after the fourth bus write cycle, when an arbitrary flash memory area is read, the id value will be loaded. once the fourth bus write cycle of an id-read command has passed, the device will not automatically return to the read mode. in this condition, the set of the fourth bus write cycle and id-read commands can be repetitively executed. for returning to the read mode, use the read/reset command or hardware reset command.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 46 / 54 - (5) flash control/ status register this resister is used to monitor the status of the flash memory and to indicate the protection status of each block. table 23-13 flash control register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - fcflcs read/write r 0x41ff_f020 after reset 0 function ?0? is read. 23 22 21 20 19 18 17 16 bit symbol - - blpro5 blpro4 blpro3 blpro2 blpro1 blpro0 read/write r r r r r r r after reset 0 note 2 note 2 note 2 note 2 note 2 note 2 function ?0? is read. protection for block 5 0: disabled 1:enabled protection for block 4 0: disabled 1:enabled protection for block 3 0: disabled 1:enabled protection for block 2 0: disabled 1:enabled protection for block 1 0: disabled 1:enabled protection for block 0 0: disabled 1:enabled 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r after reset 0 function ?0? is read. 7 6 5 4 3 2 1 0 bit symbol - - - - - - - rdy/bsy read/write r r after reset 0 1 function ?0? is read. ready/bus y (note 1) 0:auto operating 1:auto operation terminated bit 0: ready/busy flag bit the rdy/bsy output is provided as a means to monitor the status of automatic operation. this bit is a function bit for the cpu to moni tor the function. when the flash memory is in automatic operation, it outputs "0" to indicate that it is busy. when the automatic operation is terminated, it returns to the ready stat e and outputs "1" to accept the next command. if the automatic operation has failed, this bit maintains the "0" output. by applying a hardware reset, it returns to "1." bit [21:16]: protection status bits each of the protection bits represents the pr otection status of the corresponding block. when a bit is set to "1," it indicates that t he block corresponding to the bit is protected. when the block is protected, data cannot be written to it.
tmpm380/m382 tmpm380/m382 - 47 / 54 - table 23-14 security bit register 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - fcsecbit read/write r 0x41ff_f010 after reset 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r after reset 0 function ?0? is read 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r after reset 0 function ?0? is read 7 6 5 4 3 2 1 0 bit symbol - - - - - - - secbit read/write r r/w after reset 0 1 function ?0? is read security bits 0:disabled 1:enabled (note 1) this command must be issued in the ready state. issuing the command in the busy state may disable both correct command transmission and further command input. to exit from the conditi on, execute system reset. system reset requires at least 0.5 microseconds regardless of the system clock frequency. in this condition, it takes approx. 2 ms to enable reading after reset. (note 2) the value varies depending on protection applied. ? (note) this register is initialized only by power-on reset.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 48 / 54 - (6) list of command sequences table 23-15 flash memory access from the internal cpu first bus cycle second bus cycle third bus cycle fourth bus cycle fifth bus cycle sixth bus cycle seventh bus cycle addr. addr. addr. addr. addr. addr. addr. command sequence data data data data data data data 0xxx read 0xf0 0x54xx 0xaaxx 0x54xx ra read/reset 0xaa 0x55 0xf0 rd 0x54xx 0xaaxx 0x54xx ia 0xxx id-read 0xaa 0x55 0x90 0x00 id 0x54xx 0xaaxx 0x54xx pa pa pa pa automatic page programming 0xaa 0x55 0xa0 pd0 pd1 pd2 pd3 0x54xx 0xaaxx 0x54xx 0x54xx 0xaaxx 0x54xx automatic chip erase 0xaa 0x55 0x80 0xaa 0x55 0x10 0x54xx 0xaaxx 0x54xx 0x54xx 0xaaxx ba auto block erase 0xaa 0x55 0x80 0xaa 0x55 0x30 0x54xx 0xaaxx 0x54xx 0x54xx 0xaaxx 0x54xx pba protection bit programming 0xaa 0x55 0x9a 0xaa 0x55 0x9a 0x9a 0x54xx 0xaaxx 0x54xx 0x54xx 0xaaxx 0x54xx pba protection bit erase 0xaa 0x55 0x6a 0xaa 0x55 0x6a 0x6a supplementary explanation ? ra: read address ? rd: read data ? ia: id address ? id: id data ? pa: program page address pd: program data (32 bit data) after the fourth bus cycle, enter data in the order of the address for a page. ? ba: block address ? pba: protection bit address (note 1) always set "0" to the address bits [1:0] in the entire bus cycle. (recommendable setting values to bits [7:2] are ?0?.) (note 2) bus cycles are "bus write cycles" except for the second bus cycle of the read command, the fourth bus cycle of the read/reset command, and the fifth bus cycle of the id-read command. bus write cycles are executed by 32-bit data transfer commands. the address [31:16] in each bus write cycle should be the target flash memory address [31:16] of the command sequence. use "addr." in the table for the address [15:0].
tmpm380/m382 tmpm380/m382 - 49 / 54 - (7) address bit configuration for bus write cycles table 23-16 address bit configuration for bus write cycles address addr [31:19] addr [18] addr [17] addr [16] addr [15] addr [14] addr [13:11] addr [10] addr [9] addr [8] addr [7:0] normal bus write cycle address configuration normal commands flash area ?0? is recommended. command addr[1:0]=?0? (fixed) others:0 (recommended) ia: id address (set the fourth bus write cycle address for id-read operation) id -read flash area ?0? is recommended. id address addr[1:0]=?0? (fixed) , others:0 (recommended) ba: block address (set the sixth bus write cycle address for block erase operation) block erase block selection ( table 23-17) addr[1:0]=?0? (fixed) , others:0 (recommended) pa: program page address (set the fourth bus write cycle address for page programming operation) auto page programming page selection addr[1:0]=?0? (fixed) others:0 (recommended) pba: protection bit address (set the seventh bus erase cycle address for protection bit erasure) protection bit programming flash area protection bit selection ( table 23-18) fi x ed to ?0?. protection bit selection ( table 23-18) addr[1:0 ]= ?0? (fixed) others:0 (recommended) pba: protection bit address (set the seventh bus erase cycle address for protection bit erasure) protection bit erase flash area protection bit selection ( table 23-19) ?0? i s recommended. protection bit selection ( table 23-19) addr[1 :0]= ?0? (fixed) others:0 (recommended) ba: block address (set the sixth bus write cycle address for block erase operation) block erase block selection ( table 23-17) addr[1:0]=?0? (fixed) , others:0 (recommended) (note 1) table 23-15 ? operation modes ? can also be used. (note 2) address setting can be performed according to the "normal bus write cycle address configuration" from the first bus cycle. (note 3) "0" is recommended" can be changed as necessary. ??
23 flash memory operation tmpm380/m382 tmpm380/m382 - 50 / 54 - table 23-17 block address table ? block address (user boot mode) address (single boot mode) size (kbyte) 4 0x0000_0000-0x0000_3fff 0x3f80_0000-0x3f80_3fff 16 5 0x0000_4000-0x0000_7fff 0x3f80_4000-0x3f80_7fff 16 3 0x0000_8000-0x0000_ffff 0x3f80_8000-0x3f80_ffff 32 2 0x0001_0000-0x0001_ffff 0x3f81_0000-0x3f81_ffff 64 1 0x0002_0000-0x0002_ffff 0x3f82_0000-0x3f82_ffff 64 0 0x0003_0000-0x0003_ffff 0x3f83_8000-0x3f83_ffff 64 as block address, specify any address in the block to be erased. (note) as for the addresses from the first to the fifth bus cycles, specify the upper 4 bit with the corresponding flash memory addresses of the blocks to be erased.
tmpm380/m382 tmpm380/m382 - 51 / 54 - table 23-18 protection bit programming address table the seventh bus write cycle address block protection bit address [18] address [17] address [16] address [15:11] address [10] address [9] address [8] block0 blpro0 0 0 0 0 block1 blpro1 0 0 0 1 block2 blpro2 0 0 1 0 block3 blpro3 0 0 1 1 block4 blpro4 0 1 0 0 block5 blpro5 0 1 fixed to ?0?. 0 1 table 23-19 protection bit erase address table the seventh bus write cycle address [18:17] block protection bit address [18] address [17] block0 to 3 blpro0 to 3 0 0 block4 to 5 blpro4 to 5 0 1 (note) the protection bit erase command cannot erase by individual block.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 52 / 54 - table 23-20 the id-read command's fourth bus write cycle id address (ia) and the data to be read by the following 32-bit data transfer command (id) ia [15:14] id [7: 0 ] code 00b 0x98 manufact urer code 01b 0x5a device code 10b reserved --- 11b 0x13 macro code
tmpm380/m382 tmpm380/m382 - 53 / 54 - (8) flowchart fig 23-14 automatic programming automatic page programming command sequence (see the flowchart shown below) the address of the last page? start no yes automatic page programming address = address + 0x200 (set by a page) automatic page programming command sequence (address/ command) 0x54xx/0xaa 0xaaxx/0x55 0x54xx/0xa0 programming address (page address)/ programming data (32 bit data) (note) command sequence is executed by 0x54xx or 0x55xx.
23 flash memory operation tmpm380/m382 tmpm380/m382 - 54 / 54 - fig 23-15 automatic erase automatic chip erase command sequence (see the flowchart shown below) start automatic chip erase completed automatic chip erase command sequence (address/ command) 0x54xx/0xaa 0xaaxx/0x55 0x54xx/0x80 0x54xx/0xaa 0xaaxx/0x55 0x54xx/0x10 automatic block/ multi-block erase command sequence (address/ command) 0x54xx/0xaa 0xaaxx/0x55 0x54xx/0x80 0x54xx/0xaa 0xaaxx/0x55 block address/0x30 (note) command sequence is executed by 0x54xx or 0x55xx.
tmpm380/m382 tmpm380/m382 - 1 / 5 - 24 protect/security function 24.1 outline the tmpm380 offers two kinds of rom protect/ secu rity functions. one is a write/ erase-protect function for the internal flash rom data. the other is a security function that restricts internal flash rom data readout and debugging. 24.2 feature 24.2.1 internal flash rom write/erase protect the write/ erase-protect function enables the internal flash to prohibit the writing and erasing operation for each block. this function is available with a single chip mode, single boot mode and writer mode. to activate the function, write ?1? to the corresponding bits to a block to protect. writing ?0? to the bits cancels the protection. the protection status of the bits can be monitored by the fcflcs bit. important tmpm380fw ,m382fw(128k version) does not flash memory block0,block1. please do not use these functions if you use this product. tmpm382fs (64k version) does not flash memory block0,block1,block2. please do not use these functions if you use this product.
24 protect/security function tmpm380/m382 tmpm380/m382 - 2 / 5 - ? 24.2.2 security function the security function restricts flash rom data readout and debugging. this function is available under the conditions shown below. 1) the fcsecbit bit is set to?1?. 2) all the protection bits (the fcflcs bits) used to the write/erase-protect function are set to ?1?. note) the fcsecbit bit is set to ?1 ? at a power-on reset right after power-on. table 24-1 shows det ails of the restri cti ons by the security function. table 24-1 restrictions by the security function item details 1) rom data readout data in the rom area cannot be read out when writer mode is set. by executing readout, the company code 0x0098 is read. the rom reading operation is available with a single chip mode and single boot mode. 2) debug port communication of jtag/sw and trace are prohibited. 3) command for flash memory writing a command to the flash memory is prohibited. an attempt to erase the contents in the bits used for the write/erase-protection will eras e all the contents of flash memory include protection bits.
tmpm380/m382 tmpm380/m382 - 3 / 5 - 24.3 resisters the flash control register shows the status of t he flash memory operation and the protection of each block. table 24-2 flash control resister 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - fcflcs read/write r 0x41ff_f020 after reset 0 function ?0? is read 23 22 21 20 19 18 17 16 bit symbol - - blpro5 blpro4 blpro3 blpro2 blpro1 blpro0 read/write r r r r r r r after reset 0 (note2) (note2) ( note2) (note2) (note2) (note2) function reading data is ?0? block5 protect status 0: no protect status. 1: protect status. block4 protect status 0: no protect status. 1: protect status. block3 protect status 0: no protect status. 1: protect status. block2 protect status 0: no protect status. 1: protect status. block1 protect status 0: no protect status. 1: protect status. block0 protect status 0: no protect status. 1: protect status. 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r after reset 0 function reading data is ?0? 7 6 5 4 3 2 1 0 bit symbol - - - - - - - rdy/bsy read/write r r after reset 0 1 function reading data is ?0? ready/ busy (note1) 0:under automatic operation 1:automati c operation is finished bit 0: ready/busy flag bit the rdy/bsy output is provided as a means to m onitor the status of automatic operation. . when the flash memory is in automatic operation, it outputs "0" to indicate that it is busy. when the automatic operation is terminated, it returns to the ready state and outputs "1" to accept the next command. if the automatic oper ation has failed, this bit maintains the "0" output. by applying a hardware reset, it returns to "1." bit [21:16]: protection status bits each of the protection bits (6 bits) represents the protection status of the corresponding block. when a bit is set to "1", it indicates that the block corresponding to the bit is protected. when the block is protected, data cannot be written to it.
24 protect/security function tmpm380/m382 tmpm380/m382 - 4 / 5 - ? table 24-3 security bit resister 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - fcsecbit read/write r 0x41ff_f010 after reset 0 function reading data is ?0? 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r after reset 0 function reading data is ?0? 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r after reset 0 function reading data is ?0? 7 6 5 4 3 2 1 0 bit symbol - - - - - - - secbit read/write r r/w after reset 0 1 function reading data is ?0? security bit 0: disable 1: enable (note 1) this command must be issued in the ready state. issuing the command in the busy state may disable both correct command transmission and further command input. to exit from the condition, execute system reset. system reset requires at least 0.5 microseconds regardle ss of the system clock frequency. in this condition, it takes approx. 2 ms to enable reading after reset. (note 2) the value varies depending on protection status. (note) this register is initia lized only by power-on reset.
tmpm380/m382 tmpm380/m382 - 5 / 5 - 24.4 writing and erasing 24.4.1 protection bits writing and erasing protection bits are availabl e with a single chip mode, single boot mode and writer mode. writing to the protection bits is done on block-by-block basis. erasing of the protection bits is done by two groups of the blocks: block 0 through 3 and block 4 through 5. when the settings for all the blocks are ?1?, erasing must be done after clearing the fcsecbit bit to ?0?. an attempt to erase protection bits when bit is ?1?, it will erases all the contents of flash memory include prot ection bits. to write and erase the protection bits, command sequence is used. see chapter 23 flash memory operation for details. 24.4.2 security bit the fcsecbit bit that activates security function is set to ?1? at a power-on reset right after power-on. it can be rewritten at single chip mode and single boot mode.by the following procedure. 1) write the code 0xa74a9d23 to fcsecbit register. 2) write data within 16 clocks from the writing above. note) the above procedure is enabled only when using 32-bit data transfer command.
tmpm380/m382 tmpm380/m382 - 1 / 49 - ? 25 special function registers [1] port registers [2] 16-bit timer (tmrb) [3] encoder input (enc) [4] ? serial bus interface (sbi) [5] serial interface (uart/sio) [6] 12-bit a/d converter (a/dc) [7] watchdog timer (wdt) [8] ? real time clock (rtc) [9] clock gene rator (cg) [10] remote control signal preprocessor (rmc) [11] oscillation frequency detector (ofd) [12] power on reset (por), voltage detecting circuit (vltd) [13] multi purpose timer ( mpt (tmr,igbt,pmd)) [14] dma controller (dmac) [15] ssp controller [16] flash controller (note 1) as for the internal i/o areas (0x4000_0000~0x4007_ffff), reading the areas not described in this chapter yields undefined value. writing these areas is ignored. (note 2) (note3) means 0(zero) is read. writing data is disregarded. access to the areas is prohibited.
25 special function registers tmpm380/m382 tmpm380/m382 - 2 / 49 - ? 25.1 addresses for tmpm380 25.1.1 [1] port [1/5] address register name address register name address register name address register name 0x4000_0000 padata 0x4000_0010 0x4000_0020 0x4000_0030 papdn 0x4000_0001 0x4000_0011 0x4000_0021 0x4000_0031 0x4000_0002 0x4000_0012 0x4000_0022 0x4000_0032 0x4000_0003 0x4000_0013 0x4000_0023 0x4000_0033 0x4000_0004 pacr 0x4000_0014 0x4000_0024 0x4000_0034 0x4000_0005 0x4000_0015 0x4000_0025 0x4000_0035 0x4000_0006 0x4000_0016 0x4000_0026 0x4000_0036 0x4000_0007 0x4000_0017 0x4000_0027 0x4000_0037 0x4000_0008 pafr1 0x4000_0018 0x4000_0028 paod 0x4000_0038 paie 0x4000_0009 0x4000_0019 0x4000_0029 0x4000_0039 0x4000_000a 0x4000_001a 0x4000_002a 0x4000_003a 0x4000_000b 0x4000_001b 0x4000_002b 0x4000_003b 0x4000_000c pafr2 0x4000_001c 0x4000_002c papup 0x4000_003c 0x4000_000d 0x4000_001d 0x4000_002d 0x4000_003d 0x4000_000e 0x4000_001e 0x4000_002e 0x4000_003e 0x4000_000f 0x4000_001f 0x4000_002f 0x4000_003f address register name address register name address register name address register name 0x4000_0040 pbdata 0x4000_0050 0x4000_0060 0x4000_0070 pbpdn 0x4000_0041 0x4000_0051 0x4000_0061 0x4000_0071 0x4000_0042 0x4000_0052 0x4000_0062 0x4000_0072 0x4000_0043 0x4000_0053 0x4000_0063 0x4000_0073 0x4000_0044 pbcr 0x4000_0054 0x4000_0064 0x4000_0074 0x4000_0045 0x4000_0055 0x4000_0065 0x4000_0075 0x4000_0046 0x4000_0056 0x4000_0066 0x4000_0076 0x4000_0047 0x4000_0057 0x4000_0067 0x4000_0077 0x4000_0048 pbfr1 0x4000_0058 0x4000_0068 pbod 0x4000_0078 pbie 0x4000_0049 0x4000_0059 0x4000_0069 0x4000_0079 0x4000_004a 0x4000_005a 0x4000_006a 0x4000_007a 0x4000_004b 0x4000_005b 0x4000_006b 0x4000_007b 0x4000_004c 0x4000_005c 0x4000_006c pbpup 0x4000_007c 0x4000_004d 0x4000_005d 0x4000_006d 0x4000_007d 0x4000_004e 0x4000_005e 0x4000_006e 0x4000_007e 0x4000_004f 0x4000_005f 0x4000_006f 0x4000_007f address register name address register name address register name address register name 0x4000_0080 pcdata 0x4000_0090 pcfr3 0x4000_00a0 0x4000_00b0 pcpdn 0x4000_0081 0x4000_0091 0x4000_00a1 0x4000_00b1 0x4000_0082 0x4000_0092 0x4000_00a2 0x4000_00b2 0x4000_0083 0x4000_0093 0x4000_00a3 0x4000_00b3 0x4000_0084 pccr 0x4000_0094 pcfr4 0x4000_00a4 0x4000_00b4 0x4000_0085 0x4000_0095 0x4000_00a5 0x4000_00b5 0x4000_0086 0x4000_0096 0x4000_00a6 0x4000_00b6 0x4000_0087 0x4000_0097 0x4000_00a7 0x4000_00b7 0x4000_0088 pcfr1 0x4000_0098 pcfr5 0x4000_00a8 pcod 0x4000_00b8 pcie 0x4000_0089 0x4000_0099 0x4000_00a9 0x4000_00b9 0x4000_008a 0x4000_009a 0x4000_00aa 0x4000_00ba 0x4000_008b 0x4000_009b 0x4000_00ab 0x4000_00bb 0x4000_008c pcfr2 0x4000_009c 0x4000_00ac pcpup 0x4000_00bc 0x4000_008d 0x4000_009d 0x4000_00ad 0x4000_00bd 0x4000_008e 0x4000_009e 0x4000_00ae 0x4000_00be 0x4000_008f 0x4000_009f 0x4000_00af 0x4000_00bf
tmpm380/m382 tmpm380/m382 - 3 / 49 - ? [1] port [2/5] address register name address register name address register name address register name 0x4000_00c0 pddata 0x4000_00d0 pdfr3 0x4000_00e0 0x4000_00f0 pdpdn 0x4000_00c1 0x4000_00d1 0x4000_00e1 0x4000_00f1 0x4000_00c2 0x4000_00d2 0x4000_00e2 0x4000_00f2 0x4000_00c3 0x4000_00d3 0x4000_00e3 0x4000_00f3 0x4000_00c4 pdcr 0x4000_00d4 0x4000_00e4 0x4000_00f4 0x4000_00c5 0x4000_00d5 0x4000_00e5 0x4000_00f5 0x4000_00c6 0x4000_00d6 0x4000_00e6 0x4000_00f6 0x4000_00c7 0x4000_00d7 0x4000_00e7 0x4000_00f7 0x4000_00c8 pdfr1 0x4000_00d8 0x4000_00e8 pdod 0x4000_00f8 pdie 0x4000_00c9 0x4000_00d9 0x4000_00e9 0x4000_00f9 0x4000_00ca 0x4000_00da 0x4000_00ea 0x4000_00fa 0x4000_00cb 0x4000_00db 0x4000_00eb 0x4000_00fb 0x4000_00cc pdfr2 0x4000_00dc 0x4000_00ec pdpup 0x4000_00fc 0x4000_00cd 0x4000_00dd 0x4000_00ed 0x4000_00fd 0x4000_00ce 0x4000_00de 0x4000_00ee 0x4000_00fe 0x4000_00cf 0x4000_00df 0x4000_00ef 0x4000_00ff address register name address register name address register name address register name 0x4000_0100 pedata 0x4000_0110 0x4000_0120 0x4000_0130 pepdn 0x4000_0101 0x4000_0111 0x4000_0121 0x4000_0131 0x4000_0102 0x4000_0112 0x4000_0122 0x4000_0132 0x4000_0103 0x4000_0113 0x4000_0123 0x4000_0133 0x4000_0104 pecr 0x4000_0114 0x4000_0124 0x4000_0134 0x4000_0105 0x4000_0115 0x4000_0125 0x4000_0135 0x4000_0106 0x4000_0116 0x4000_0126 0x4000_0136 0x4000_0107 0x4000_0117 0x4000_0127 0x4000_0137 0x4000_0108 pefr1 0x4000_0118 0x4000_0128 peod 0x4000_0138 peie 0x4000_0109 0x4000_0119 0x4000_0129 0x4000_0139 0x4000_010a 0x4000_011a 0x4000_012a 0x4000_013a 0x4000_010b 0x4000_011b 0x4000_012b 0x4000_013b 0x4000_010c pefr2 0x4000_011c 0x4000_012c pepup 0x4000_013c 0x4000_010d 0x4000_011d 0x4000_012d 0x4000_013d 0x4000_010e 0x4000_011e 0x4000_012e 0x4000_013e 0x4000_010f 0x4000_011f 0x4000_012f 0x4000_013f address register name address register name address register name address register name 0x4000_0140 pfdata 0x4000_0150 pffr3 0x4000_0160 0x4000_0170 pfpdn 0x4000_0141 0x4000_0151 0x4000_0161 0x4000_0171 0x4000_0142 0x4000_0152 0x4000_0162 0x4000_0172 0x4000_0143 0x4000_0153 0x4000_0163 0x4000_0173 0x4000_0144 pfcr 0x4000_0154 0x4000_0164 0x4000_0174 0x4000_0145 0x4000_0155 0x4000_0165 0x4000_0175 0x4000_0146 0x4000_0156 0x4000_0166 0x4000_0176 0x4000_0147 0x4000_0157 0x4000_0167 0x4000_0177 0x4000_0148 pffr1 0x4000_0158 0x4000_0168 pfod 0x4000_0178 pfie 0x4000_0149 0x4000_0159 0x4000_0169 0x4000_0179 0x4000_014a 0x4000_015a 0x4000_016a 0x4000_017a 0x4000_014b 0x4000_015b 0x4000_016b 0x4000_017b 0x4000_014c pffr2 0x4000_015c 0x4000_016c pfpup 0x4000_017c 0x4000_014d 0x4000_015d 0x4000_016d 0x4000_017d 0x4000_014e 0x4000_015e 0x4000_016e 0x4000_017e 0x4000_014f 0x4000_015f 0x4000_016f 0x4000_017f
25 special function registers tmpm380/m382 tmpm380/m382 - 4 / 49 - [1] port [3/5] address register name address register name address register name address register name 0x4000_0180 pgdata 0x4000_0190 pgfr3 0x4000_01a0 0x4000_01b0 pgpdn 0x4000_0181 0x4000_0191 0x4000_01a1 0x4000_01b1 0x4000_0182 0x4000_0192 0x4000_01a2 0x4000_01b2 0x4000_0183 0x4000_0193 0x4000_01a3 0x4000_01b3 0x4000_0184 pgcr 0x4000_0194 0x4000_01a4 0x4000_01b4 0x4000_0185 0x4000_0195 0x4000_01a5 0x4000_01b5 0x4000_0186 0x4000_0196 0x4000_01a6 0x4000_01b6 0x4000_0187 0x4000_0197 0x4000_01a7 0x4000_01b7 0x4000_0188 pgfr1 0x4000_0198 0x4000_01a8 pgod 0x4000_01b8 pgie 0x4000_0189 0x4000_0199 0x4000_01a9 0x4000_01b9 0x4000_018a 0x4000_019a 0x4000_01aa 0x4000_01ba 0x4000_018b 0x4000_019b 0x4000_01ab 0x4000_01bb 0x4000_018c pgfr2 0x4000_019c 0x4000_01ac pgpup 0x4000_01bc 0x4000_018d 0x4000_019d 0x4000_01ad 0x4000_01bd 0x4000_018e 0x4000_019e 0x4000_01ae 0x4000_01be 0x4000_018f 0x4000_019f 0x4000_01af 0x4000_01bf address register name address register name address register name address register name 0x4000_01c0 phdata 0x4000_01d0 0x4000_01e0 0x4000_01f0 phpdn 0x4000_01c1 0x4000_01d1 0x4000_01e1 0x4000_01f1 0x4000_01c2 0x4000_01d2 0x4000_01e2 0x4000_01f2 0x4000_01c3 0x4000_01d3 0x4000_01e3 0x4000_01f3 0x4000_01c4 phcr 0x4000_01d4 0x4000_01e4 0x4000_01f4 0x4000_01c5 0x4000_01d5 0x4000_01e5 0x4000_01f5 0x4000_01c6 0x4000_01d6 0x4000_01e6 0x4000_01f6 0x4000_01c7 0x4000_01d7 0x4000_01e7 0x4000_01f7 0x4000_01c8 phfr1 0x4000_01d8 0x4000_01e8 phod 0x4000_01f8 phie 0x4000_01c9 0x4000_01d9 0x4000_01e9 0x4000_01f9 0x4000_01ca 0x4000_01da 0x4000_01ea 0x4000_01fa 0x4000_01cb 0x4000_01db 0x4000_01eb 0x4000_01fb 0x4000_01cc 0x4000_01dc 0x4000_01ec phpup 0x4000_01fc 0x4000_01cd 0x4000_01dd 0x4000_01ed 0x4000_01fd 0x4000_01ce 0x4000_01de 0x4000_01ee 0x4000_01fe 0x4000_01cf 0x4000_01df 0x4000_01ef 0x4000_01ff address register name address register name address register name address register name 0x4000_0200 pidata 0x4000_0210 0x4000_0220 0x4000_0230 pipdn 0x4000_0201 0x4000_0211 0x4000_0221 0x4000_0231 0x4000_0202 0x4000_0212 0x4000_0222 0x4000_0232 0x4000_0203 0x4000_0213 0x4000_0223 0x4000_0233 0x4000_0204 picr 0x4000_0214 0x4000_0224 0x4000_0234 0x4000_0205 0x4000_0215 0x4000_0225 0x4000_0235 0x4000_0206 0x4000_0216 0x4000_0226 0x4000_0236 0x4000_0207 0x4000_0217 0x4000_0227 0x4000_0237 0x4000_0208 0x4000_0218 0x4000_0228 piod 0x4000_0238 piie 0x4000_0209 0x4000_0219 0x4000_0229 0x4000_0239 0x4000_020a 0x4000_021a 0x4000_022a 0x4000_023a 0x4000_020b 0x4000_021b 0x4000_022b 0x4000_023b 0x4000_020c 0x4000_021c 0x4000_022c pipup 0x4000_023c 0x4000_020d 0x4000_021d 0x4000_022d 0x4000_023d 0x4000_020e 0x4000_021e 0x4000_022e 0x4000_023e 0x4000_020f 0x4000_021f 0x4000_022f 0x4000_023f
tmpm380/m382 tmpm380/m382 - 5 / 49 - ? [1] port [4/5] address register name address register name address register name address register name 0x4000_0240 pjdata 0x4000_0250 0x4000_0260 0x4000_0270 pjpdn 0x4000_0241 0x4000_0251 0x4000_0261 0x4000_0271 0x4000_0242 0x4000_0252 0x4000_0262 0x4000_0272 0x4000_0243 0x4000_0253 0x4000_0263 0x4000_0273 0x4000_0244 pjcr 0x4000_0254 0x4000_0264 0x4000_0274 0x4000_0245 0x4000_0255 0x4000_0265 0x4000_0275 0x4000_0246 0x4000_0256 0x4000_0266 0x4000_0276 0x4000_0247 0x4000_0257 0x4000_0267 0x4000_0277 0x4000_0248 pjfr1 0x4000_0258 0x4000_0268 pjod 0x4000_0278 pjie 0x4000_0249 0x4000_0259 0x4000_0269 0x4000_0279 0x4000_024a 0x4000_025a 0x4000_026a 0x4000_027a 0x4000_024b 0x4000_025b 0x4000_026b 0x4000_027b 0x4000_024c 0x4000_025c 0x4000_026c pjpup 0x4000_027c 0x4000_024d 0x4000_025d 0x4000_026d 0x4000_027d 0x4000_024e 0x4000_025e 0x4000_026e 0x4000_027e 0x4000_024f 0x4000_025f 0x4000_026f 0x4000_027f address register name address register name address register name address register name 0x4000_0280 0x4000_0290 0x4000_02a0 0x4000_02b0 0x4000_0281 0x4000_0291 0x4000_02a1 0x4000_02b1 0x4000_0282 0x4000_0292 0x4000_02a2 0x4000_02b2 0x4000_0283 0x4000_0293 0x4000_02a3 0x4000_02b3 0x4000_0284 0x4000_0294 0x4000_02a4 0x4000_02b4 0x4000_0285 0x4000_0295 0x4000_02a5 0x4000_02b5 0x4000_0286 0x4000_0296 0x4000_02a6 0x4000_02b6 0x4000_0287 0x4000_0297 0x4000_02a7 0x4000_02b7 0x4000_0288 0x4000_0298 0x4000_02a8 0x4000_02b8 0x4000_0289 0x4000_0299 0x4000_02a9 0x4000_02b9 0x4000_028a 0x4000_029a 0x4000_02aa 0x4000_02ba 0x4000_028b 0x4000_029b 0x4000_02ab 0x4000_02bb 0x4000_028c 0x4000_029c 0x4000_02ac 0x4000_02bc 0x4000_028d 0x4000_029d 0x4000_02ad 0x4000_02bd 0x4000_028e 0x4000_029e 0x4000_02ae 0x4000_02be 0x4000_028f 0x4000_029f 0x4000_02af 0x4000_02bf address register name address register name address register name address register name 0x4000_02c0 pldata 0x4000_02d0 0x4000_02e0 0x4000_02f0 plpdn 0x4000_02c1 0x4000_02d1 0x4000_02e1 0x4000_02f1 0x4000_02c2 0x4000_02d2 0x4000_02e2 0x4000_02f2 0x4000_02c3 0x4000_02d3 0x4000_02e3 0x4000_02f3 0x4000_02c4 plcr 0x4000_02d4 0x4000_02e4 0x4000_02f4 0x4000_02c5 0x4000_02d5 0x4000_02e5 0x4000_02f5 0x4000_02c6 0x4000_02d6 0x4000_02e6 0x4000_02f6 0x4000_02c7 0x4000_02d7 0x4000_02e7 0x4000_02f7 0x4000_02c8 plfr1 0x4000_02d8 0x4000_02e8 plod 0x4000_02f8 plie 0x4000_02c9 0x4000_02d9 0x4000_02e9 0x4000_02f9 0x4000_02ca 0x4000_02da 0x4000_02ea 0x4000_02fa 0x4000_02cb 0x4000_02db 0x4000_02eb 0x4000_02fb 0x4000_02cc 0x4000_02dc 0x4000_02ec plpup 0x4000_02fc 0x4000_02cd 0x4000_02dd 0x4000_02ed 0x4000_02fd 0x4000_02ce 0x4000_02de 0x4000_02ee 0x4000_02fe 0x4000_02cf 0x4000_02df 0x4000_02ef 0x4000_02ff
25 special function registers tmpm380/m382 tmpm380/m382 - 6 / 49 - [1] port [5/5] address register name address register name address register name address register name 0x4000_0300 pmdata 0x4000_0310 0x4000_0320 0x4000_0330 pmpdn 0x4000_0301 0x4000_0311 0x4000_0321 0x4000_0331 0x4000_0302 0x4000_0312 0x4000_0322 0x4000_0332 0x4000_0303 0x4000_0313 0x4000_0323 0x4000_0333 0x4000_0304 pmcr 0x4000_0314 0x4000_0324 0x4000_0334 0x4000_0305 0x4000_0315 0x4000_0325 0x4000_0335 0x4000_0306 0x4000_0316 0x4000_0326 0x4000_0336 0x4000_0307 0x4000_0317 0x4000_0327 0x4000_0337 0x4000_0308 0x4000_0318 0x4000_0328 pmod 0x4000_0338 pmie 0x4000_0309 0x4000_0319 0x4000_0329 0x4000_0339 0x4000_030a 0x4000_031a 0x4000_032a 0x4000_033a 0x4000_030b 0x4000_031b 0x4000_032b 0x4000_033b 0x4000_030c 0x4000_031c 0x4000_032c pmpup 0x4000_033c 0x4000_030d 0x4000_031d 0x4000_032d 0x4000_033d 0x4000_030e 0x4000_031e 0x4000_032e 0x4000_033e 0x4000_030f 0x4000_031f 0x4000_032f 0x4000_033f address register name address register name address register name address register name 0x4000_0340 pndata 0x4000_0350 0x4000_0360 0x4000_0370 pnpdn 0x4000_0341 0x4000_0351 0x4000_0361 0x4000_0371 0x4000_0342 0x4000_0352 0x4000_0362 0x4000_0372 0x4000_0343 0x4000_0353 0x4000_0363 0x4000_0373 0x4000_0344 pncr 0x4000_0354 0x4000_0364 0x4000_0374 0x4000_0345 0x4000_0355 0x4000_0365 0x4000_0375 0x4000_0346 0x4000_0356 0x4000_0366 0x4000_0376 0x4000_0347 0x4000_0357 0x4000_0367 0x4000_0377 0x4000_0348 pnfr1 0x4000_0358 0x4000_0368 pnod 0x4000_0378 pnie 0x4000_0349 0x4000_0359 0x4000_0369 0x4000_0379 0x4000_034a 0x4000_035a 0x4000_036a 0x4000_037a 0x4000_034b 0x4000_035b 0x4000_036b 0x4000_037b 0x4000_034c pnfr2 0x4000_035c 0x4000_036c pnpup 0x4000_037c 0x4000_034d 0x4000_035d 0x4000_036d 0x4000_037d 0x4000_034e 0x4000_035e 0x4000_036e 0x4000_037e 0x4000_034f 0x4000_035f 0x4000_036f 0x4000_037f address register name address register name address r egister name address register name 0x4000_0380 ppdata 0x4000_0390 0x4000_03a0 0x4000_03b0 pppdn 0x4000_0381 0x4000_0391 0x4000_03a1 0x4000_03b1 0x4000_0382 0x4000_0392 0x4000_03a2 0x4000_03b2 0x4000_0383 0x4000_0393 0x4000_03a3 0x4000_03b3 0x4000_0384 ppcr 0x4000_0394 0x4000_03a4 0x4000_03b4 0x4000_0385 0x4000_0395 0x4000_03a5 0x4000_03b5 0x4000_0386 0x4000_0396 0x4000_03a6 0x4000_03b6 0x4000_0387 0x4000_0397 0x4000_03a7 0x4000_03b7 0x4000_0388 0x4000_0398 0x4000_03a8 ppod 0x4000_03b8 ppie 0x4000_0389 0x4000_0399 0x4000_03a9 0x4000_03b9 0x4000_038a 0x4000_039a 0x4000_03aa 0x4000_03ba 0x4000_038b 0x4000_039b 0x4000_03ab 0x4000_03bb 0x4000_038c 0x4000_039c 0x4000_03ac pppup 0x4000_03bc 0x4000_038d 0x4000_039d 0x4000_03ad 0x4000_03bd 0x4000_038e 0x4000_039e 0x4000_03ae 0x4000_03be 0x4000_038f 0x4000_039f 0x4000_03af 0x4000_03bf
tmpm380/m382 tmpm380/m382 - 7 / 49 - ? ? 25.1.2 [2] 16-bit timer [1/3] address register name address register name address register name address register name 0x4001_0000 tb0en 0x4001_0010 tb0ffcr 0x4001_0020 tb0rg0 0x4001_0030 0x4001_0001 0x4001_0011 0x4001_0021 0x4001_0031 0x4001_0002 0x4001_0012 0x4001_0022 0x4001_0032 0x4001_0003 0x4001_0013 0x4001_0023 0x4001_0033 0x4001_0004 tb0run 0x4001_0014 tb0st 0x4001_0024 tb0rg1 0x4001_0034 0x4001_0005 0x4001_0015 0x4001_0025 0x4001_0035 0x4001_0006 0x4001_0016 0x4001_0026 0x4001_0036 0x4001_0007 0x4001_0017 0x4001_0027 0x4001_0037 0x4001_0008 tb0cr 0x4001_0018 tb0im 0x4001_0028 tb0cp0 0x4001_0038 0x4001_0009 0x4001_0019 0x4001_0029 0x4001_0039 0x4001_000a 0x4001_001a 0x4001_002a 0x4001_003a 0x4001_000b 0x4001_001b 0x4001_002b 0x4001_003b 0x4001_000c tb0mod 0x4001_001c tb0uc 0x4001_002c tb0cp1 0x4001_003c 0x4001_000d 0x4001_001d 0x4001_002d 0x4001_003d 0x4001_000e 0x4001_001e 0x4001_002e 0x4001_003e 0x4001_000f 0x4001_001f 0x4001_002f 0x4001_003f address register name address register name address register name address register name 0x4001_0040 tb1en 0x4001_0050 tb1ffcr 0x4001_0060 tb1rg0 0x4001_0070 0x4001_0041 0x4001_0051 0x4001_0061 0x4001_0071 0x4001_0042 0x4001_0052 0x4001_0062 0x4001_0072 0x4001_0043 0x4001_0053 0x4001_0063 0x4001_0073 0x4001_0044 tb1run 0x4001_0054 tb1st 0x4001_0064 tb1rg1 0x4001_0074 0x4001_0045 0x4001_0055 0x4001_0065 0x4001_0075 0x4001_0046 0x4001_0056 0x4001_0066 0x4001_0076 0x4001_0047 0x4001_0057 0x4001_0067 0x4001_0077 0x4001_0048 tb1cr 0x4001_0058 tb1im 0x4001_0068 tb1cp0 0x4001_0078 0x4001_0049 0x4001_0059 0x4001_0069 0x4001_0079 0x4001_004a 0x4001_005a 0x4001_006a 0x4001_007a 0x4001_004b 0x4001_005b 0x4001_006b 0x4001_007b 0x4001_004c tb1mod 0x4001_005c tb1uc 0x4001_006c tb1cp1 0x4001_007c 0x4001_004d 0x4001_005d 0x4001_006d 0x4001_007d 0x4001_004e 0x4001_005e 0x4001_006e 0x4001_007e 0x4001_004f 0x4001_005f 0x4001_006f 0x4001_007f address register name address register name address register name address register name 0x4001_0080 tb2en 0x4001_0090 tb2ffcr 0x4001_00a0 tb2rg0 0x4001_00b0 0x4001_0081 0x4001_0091 0x4001_00a1 0x4001_00b1 0x4001_0082 0x4001_0092 0x4001_00a2 0x4001_00b2 0x4001_0083 0x4001_0093 0x4001_00a3 0x4001_00b3 0x4001_0084 tb2run 0x4001_0094 tb2st 0x4001_00a4 tb2rg1 0x4001_00b4 0x4001_0085 0x4001_0095 0x4001_00a5 0x4001_00b5 0x4001_0086 0x4001_0096 0x4001_00a6 0x4001_00b6 0x4001_0087 0x4001_0097 0x4001_00a7 0x4001_00b7 0x4001_0088 tb2cr 0x4001_0098 tb2im 0x4001_00a8 tb2cp0 0x4001_00b8 0x4001_0089 0x4001_0099 0x4001_00a9 0x4001_00b9 0x4001_008a 0x4001_009a 0x4001_00aa 0x4001_00ba 0x4001_008b 0x4001_009b 0x4001_00ab 0x4001_00bb 0x4001_008c tb2mod 0x4001_009c tb2uc 0x4001_00ac tb2cp1 0x4001_00bc 0x4001_008d 0x4001_009d 0x4001_00ad 0x4001_00bd 0x4001_008e 0x4001_009e 0x4001_00ae 0x4001_00be 0x4001_008f 0x4001_009f 0x4001_00af 0x4001_00bf
25 special function registers tmpm380/m382 tmpm380/m382 - 8 / 49 - [2] 16-bit timer [2/3] address register name address register name address register name address register name 0x4001_00c0 tb3en 0x4001_00d0 tb3ffcr 0x4001_00e0 tb3rg0 0x4001_00f0 0x4001_00c1 0x4001_00d1 0x4001_00e1 0x4001_00f1 0x4001_00c2 0x4001_00d2 0x4001_00e2 0x4001_00f2 0x4001_00c3 0x4001_00d3 0x4001_00e3 0x4001_00f3 0x4001_00c4 tb3run 0x4001_00d4 tb3st 0x4001_00e4 tb3rg1 0x4001_00f4 0x4001_00c5 0x4001_00d5 0x4001_00e5 0x4001_00f5 0x4001_00c6 0x4001_00d6 0x4001_00e6 0x4001_00f6 0x4001_00c7 0x4001_00d7 0x4001_00e7 0x4001_00f7 0x4001_00c8 tb3cr 0x4001_00d8 tb3im 0x4001_00e8 tb3cp0 0x4001_00f8 0x4001_00c9 0x4001_00d9 0x4001_00e9 0x4001_00f9 0x4001_00ca 0x4001_00da 0x4001_00ea 0x4001_00fa 0x4001_00cb 0x4001_00db 0x4001_00eb 0x4001_00fb 0x4001_00cc tb3mod 0x4001_00dc tb3uc 0x4001_00ec tb3cp1 0x4001_00fc 0x4001_00cd 0x4001_00dd 0x4001_00ed 0x4001_00fd 0x4001_00ce 0x4001_00de 0x4001_00ee 0x4001_00fe 0x4001_00cf 0x4001_00df 0x4001_00ef 0x4001_00ff address register name address register name address register name address register name 0x4001_0100 tb4en 0x4001_0110 tb4ffcr 0x4001_0120 tb4rg0 0x4001_0130 0x4001_0101 0x4001_0111 0x4001_0121 0x4001_0131 0x4001_0102 0x4001_0112 0x4001_0122 0x4001_0132 0x4001_0103 0x4001_0113 0x4001_0123 0x4001_0133 0x4001_0104 tb4run 0x4001_0114 tb4st 0x4001_0124 tb4rg1 0x4001_0134 0x4001_0105 0x4001_0115 0x4001_0125 0x4001_0135 0x4001_0106 0x4001_0116 0x4001_0126 0x4001_0136 0x4001_0107 0x4001_0117 0x4001_0127 0x4001_0137 0x4001_0108 tb4cr 0x4001_0118 tb4im 0x4001_0128 tb4cp0 0x4001_0138 0x4001_0109 0x4001_0119 0x4001_0129 0x4001_0139 0x4001_010a 0x4001_011a 0x4001_012a 0x4001_013a 0x4001_010b 0x4001_011b 0x4001_012b 0x4001_013b 0x4001_010c tb4mod 0x4001_011c tb4uc 0x4001_012c tb4cp1 0x4001_013c 0x4001_010d 0x4001_011d 0x4001_012d 0x4001_013d 0x4001_010e 0x4001_011e 0x4001_012e 0x4001_013e 0x4001_010f 0x4001_011f 0x4001_012f 0x4001_013f address register name address register name address register name address register name 0x4001_0140 tb5en 0x4001_0150 tb5ffcr 0x4001_0160 tb5rg0 0x4001_0170 0x4001_0141 0x4001_0151 0x4001_0161 0x4001_0171 0x4001_0142 0x4001_0152 0x4001_0162 0x4001_0172 0x4001_0143 0x4001_0153 0x4001_0163 0x4001_0173 0x4001_0144 tb5run 0x4001_0154 tb5st 0x4001_0164 tb5rg1 0x4001_0174 0x4001_0145 0x4001_0155 0x4001_0165 0x4001_0175 0x4001_0146 0x4001_0156 0x4001_0166 0x4001_0176 0x4001_0147 0x4001_0157 0x4001_0167 0x4001_0177 0x4001_0148 tb5cr 0x4001_0158 tb5im 0x4001_0168 tb5cp0 0x4001_0178 0x4001_0149 0x4001_0159 0x4001_0169 0x4001_0179 0x4001_014a 0x4001_015a 0x4001_016a 0x4001_017a 0x4001_014b 0x4001_015b 0x4001_016b 0x4001_017b 0x4001_014c tb5mod 0x4001_015c tb5uc 0x4001_016c tb5cp1 0x4001_017c 0x4001_014d 0x4001_015d 0x4001_016d 0x4001_017d 0x4001_014e 0x4001_015e 0x4001_016e 0x4001_017e 0x4001_014f 0x4001_015f 0x4001_016f 0x4001_017f
tmpm380/m382 tmpm380/m382 - 9 / 49 - ? [2] 16-bit timer [3/3] address register name address register name address register name address register name 0x4001_0180 tb6en 0x4001_0190 tb6ffcr 0x4001_01a0 tb6rg0 0x4001_01b0 0x4001_0181 0x4001_0191 0x4001_01a1 0x4001_01b1 0x4001_0182 0x4001_0192 0x4001_01a2 0x4001_01b2 0x4001_0183 0x4001_0193 0x4001_01a3 0x4001_01b3 0x4001_0184 tb6run 0x4001_0194 tb6st 0x4001_01a4 tb6rg1 0x4001_01b4 0x4001_0185 0x4001_0195 0x4001_01a5 0x4001_01b5 0x4001_0186 0x4001_0196 0x4001_01a6 0x4001_01b6 0x4001_0187 0x4001_0197 0x4001_01a7 0x4001_01b7 0x4001_0188 tb6cr 0x4001_0198 tb6im 0x4001_01a8 tb6cp0 0x4001_01b8 0x4001_0189 0x4001_0199 0x4001_01a9 0x4001_01b9 0x4001_018a 0x4001_019a 0x4001_01aa 0x4001_01ba 0x4001_018b 0x4001_019b 0x4001_01ab 0x4001_01bb 0x4001_018c tb6mod 0x4001_019c tb6uc 0x4001_01ac tb6cp1 0x4001_01bc 0x4001_018d 0x4001_019d 0x4001_01ad 0x4001_01bd 0x4001_018e 0x4001_019e 0x4001_01ae 0x4001_01be 0x4001_018f 0x4001_019f 0x4001_01af 0x4001_01bf address register name address register name address register name address r egister name 0x4001_01c0 tb7en 0x4001_01d0 tb7ffcr 0x4001_01e0 tb7rg0 0x4001_01f0 0x4001_01c1 0x4001_01d1 0x4001_01e1 0x4001_01f1 0x4001_01c2 0x4001_01d2 0x4001_01e2 0x4001_01f2 0x4001_01c3 0x4001_01d3 0x4001_01e3 0x4001_01f3 0x4001_01c4 tb7run 0x4001_01d4 tb7st 0x4001_01e4 tb7rg1 0x4001_01f4 0x4001_01c5 0x4001_01d5 0x4001_01e5 0x4001_01f5 0x4001_01c6 0x4001_01d6 0x4001_01e6 0x4001_01f6 0x4001_01c7 0x4001_01d7 0x4001_01e7 0x4001_01f7 0x4001_01c8 tb7cr 0x4001_01d8 tb7im 0x4001_01e8 tb7cp0 0x4001_01f8 0x4001_01c9 0x4001_01d9 0x4001_01e9 0x4001_01f9 0x4001_01ca 0x4001_01da 0x4001_01ea 0x4001_01fa 0x4001_01cb 0x4001_01db 0x4001_01eb 0x4001_01fb 0x4001_01cc tb7mod 0x4001_01dc tb7uc 0x4001_01ec tb7cp1 0x4001_01fc 0x4001_01cd 0x4001_01dd 0x4001_01ed 0x4001_01fd 0x4001_01ce 0x4001_01de 0x4001_01ee 0x4001_01fe 0x4001_01cf 0x4001_01df 0x4001_01ef 0x4001_01ff
25 special function registers tmpm380/m382 tmpm380/m382 - 10 / 49 - 25.1.3 [3] encoder input (enc) address register name address register name address register name address register name 0x4001_0400 en0tncr 0x4001_0410 0x4001_0420 0x4001_0430 0x4001_0401 0x4001_0411 0x4001_0421 0x4001_0431 0x4001_0402 0x4001_0412 0x4001_0422 0x4001_0432 0x4001_0403 0x4001_0413 0x4001_0423 0x4001_0433 0x4001_0404 en0reload 0x4001_0414 0x4001_0424 0x4001_0434 0x4001_0405 0x4001_0415 0x4001_0425 0x4001_0435 0x4001_0406 0x4001_0416 0x4001_0426 0x4001_0436 0x4001_0407 0x4001_0417 0x4001_0427 0x4001_0437 0x4001_0408 en0int 0x4001_0418 0x4001_0428 0x4001_0438 0x4001_0409 0x4001_0419 0x4001_0429 0x4001_0439 0x4001_040a 0x4001_041a 0x4001_042a 0x4001_043a 0x4001_040b 0x4001_041b 0x4001_042b 0x4001_043b 0x4001_040c en0cnt 0x4001_041c 0x4001_042c 0x4001_043c 0x4001_040d 0x4001_041d 0x4001_042d 0x4001_043d 0x4001_040e 0x4001_041e 0x4001_042e 0x4001_043e 0x4001_040f 0x4001_041f 0x4001_042f 0x4001_043f address register name address register name address register name address register name 0x4001_0500 en1tncr 0x4001_0510 0x4001_0520 0x4001_0530 0x4001_0501 0x4001_0511 0x4001_0521 0x4001_0531 0x4001_0502 0x4001_0512 0x4001_0522 0x4001_0532 0x4001_0503 0x4001_0513 0x4001_0523 0x4001_0533 0x4001_0504 en1reload 0x4001_0514 0x4001_0524 0x4001_0534 0x4001_0505 0x4001_0515 0x4001_0525 0x4001_0535 0x4001_0506 0x4001_0516 0x4001_0526 0x4001_0536 0x4001_0507 0x4001_0517 0x4001_0527 0x4001_0537 0x4001_0508 en1int 0x4001_0518 0x4001_0528 0x4001_0538 0x4001_0509 0x4001_0519 0x4001_0529 0x4001_0539 0x4001_050a 0x4001_051a 0x4001_052a 0x4001_053a 0x4001_050b 0x4001_051b 0x4001_052b 0x4001_053b 0x4001_050c en1cnt 0x4001_051c 0x4001_052c 0x4001_053c 0x4001_050d 0x4001_051d 0x4001_052d 0x4001_053d 0x4001_050e 0x4001_051e 0x4001_052e 0x4001_053e 0x4001_050f 0x4001_051f 0x4001_052f 0x4001_053f
tmpm380/m382 tmpm380/m382 - 11 / 49 - ? 25.1.4 [4] serial bus interface (sbi) address register name address register name address register name address register name 0x4002_0000 sbi0cr0 0x4002_0010 sbi0cr2/sr 0x4002_0020 sbi1cr0 0x4002_0030 sbi1cr2/sr 0x4002_0001 0x4002_0011 0x4002_0021 0x4002_0031 0x4002_0002 0x4002_0012 0x4002_0022 0x4002_0032 0x4002_0003 0x4002_0013 0x4002_0023 0x4002_0033 0x4002_0004 sbi0cr1 0x4002_0014 sbi0br0 0x4002_0024 sbi1cr1 0x4002_0034 sbi1br0 0x4002_0005 0x4002_0015 0x4002_0025 0x4002_0035 0x4002_0006 0x4002_0016 0x4002_0026 0x4002_0036 0x4002_0007 0x4002_0017 0x4002_0027 0x4002_0037 0x4002_0008 sbi0dbr 0x4002_0018 0x4002_0028 sbi1dbr 0x4002_0038 0x4002_0009 0x4002_0019 0x4002_0029 0x4002_0039 0x4002_000a 0x4002_001a 0x4002_002a 0x4002_003a 0x4002_000b 0x4002_001b 0x4002_002b 0x4002_003b 0x4002_000c sbi0i2car 0x4002_001c 0x4002_002c sbi1i2car 0x4002_003c 0x4002_000d 0x4002_001d 0x4002_002d 0x4002_003d " 0x4002_000e 0x4002_001e 0x4002_002e 0x4002_003e 0x4002_000f 0x4002_001f 0x4002_002f 0x4002_003f address register name address register name address register name address register name 0x4002_0040 0x4002_0050 0x4002_0060 0x4002_0070 0x4002_0041 0x4002_0051 0x4002_0061 0x4002_0071 0x4002_0042 0x4002_0052 0x4002_0062 0x4002_0072 0x4002_0043 0x4002_0053 0x4002_0063 0x4002_0073 0x4002_0044 0x4002_0054 0x4002_0064 0x4002_0074 0x4002_0045 0x4002_0055 0x4002_0065 0x4002_0075 0x4002_0046 0x4002_0056 0x4002_0066 0x4002_0076 0x4002_0047 0x4002_0057 0x4002_0067 0x4002_0077 0x4002_0048 0x4002_0058 0x4002_0068 0x4002_0078 0x4002_0049 0x4002_0059 0x4002_0069 0x4002_0079 0x4002_004a 0x4002_005a 0x4002_006a 0x4002_007a 0x4002_004b 0x4002_005b 0x4002_006b 0x4002_007b 0x4002_004c 0x4002_005c 0x4002_006c 0x4002_007c 0x4002_004d 0x4002_005d 0x4002_006d 0x4002_007d 0x4002_004e 0x4002_005e 0x4002_006e 0x4002_007e 0x4002_004f 0x4002_005f 0x4002_006f 0x4002_007f
25 special function registers tmpm380/m382 tmpm380/m382 - 12 / 49 - 25.1.5 [5] serial interface (uart/sio) [1/2] address register name address register name address register name address register name 0x4002_0080 sc0en 0x4002_0090 sc0brcr 0x4002_00a0 sc0rfc 0x4002_00b0 sc0fcnf 0x4002_0081 0x4002_0091 0x4002_00a1 0x4002_00b1 0x4002_0082 0x4002_0092 0x4002_00a2 0x4002_00b2 0x4002_0083 0x4002_0093 0x4002_00a3 0x4002_00b3 0x4002_0084 sc0buf 0x4002_0094 sc0bradd 0x4002_00a4 sc0tfc 0x4002_00b4 0x4002_0085 0x4002_0095 0x4002_00a5 0x4002_00b5 0x4002_0086 0x4002_0096 0x4002_00a6 0x4002_00b6 0x4002_0087 0x4002_0097 0x4002_00a7 0x4002_00b7 0x4002_0088 sc0cr 0x4002_0098 sc0mod1 0x4002_00a8 sc0rst 0x4002_00b8 0x4002_0089 0x4002_0099 0x4002_00a9 0x4002_00b9 0x4002_008a 0x4002_009a 0x4002_00aa 0x4002_00ba 0x4002_008b 0x4002_009b 0x4002_00ab 0x4002_00bb 0x4002_008c sc0mod0 0x4002_009c sc0mod2 0x4002_00ac sc0tst 0x4002_00bc 0x4002_008d 0x4002_009d 0x4002_00ad 0x4002_00bd 0x4002_008e 0x4002_009e 0x4002_00ae 0x4002_00be 0x4002_008f 0x4002_009f 0x4002_00af 0x4002_00bf address register name address register name address register name address register name 0x4002_00c0 sc1en 0x4002_00d0 sc1brcr 0x4002_00e0 sc1rfc 0x4002_00f0 sc1fcnf 0x4002_00c1 0x4002_00d1 0x4002_00e1 0x4002_00f1 0x4002_00c2 0x4002_00d2 0x4002_00e2 0x4002_00f2 0x4002_00c3 0x4002_00d3 0x4002_00e3 0x4002_00f3 0x4002_00c4 sc1buf 0x4002_00d4 sc1bradd 0x4002_00e4 sc1tfc 0x4002_00f4 0x4002_00c5 0x4002_00d5 0x4002_00e5 0x4002_00f5 0x4002_00c6 0x4002_00d6 0x4002_00e6 0x4002_00f6 0x4002_00c7 0x4002_00d7 0x4002_00e7 0x4002_00f7 0x4002_00c8 sc1cr 0x4002_00d8 sc1mod1 0x4002_00e8 sc1rst 0x4002_00f8 0x4002_00c9 0x4002_00d9 0x4002_00e9 0x4002_00f9 0x4002_00ca 0x4002_00da 0x4002_00ea 0x4002_00fa 0x4002_00cb 0x4002_00db 0x4002_00eb 0x4002_00fb 0x4002_00cc sc1mod0 0x4002_00dc sc1mod2 0x4002_00ec sc1tst 0x4002_00fc 0x4002_00cd 0x4002_00dd 0x4002_00ed 0x4002_00fd 0x4002_00ce 0x4002_00de 0x4002_00ee 0x4002_00fe 0x4002_00cf 0x4002_00df 0x4002_00ef 0x4002_00ff address register name address register name address register name address register name 0x4002_0100 sc2en 0x4002_0110 sc2brcr 0x4002_0120 sc2rfc 0x4002_0130 sc2fcnf 0x4002_0101 0x4002_0111 0x4002_0121 0x4002_0131 0x4002_0102 0x4002_0112 0x4002_0122 0x4002_0132 0x4002_0103 0x4002_0113 0x4002_0123 0x4002_0133 0x4002_0104 sc2buf 0x4002_0114 sc2bradd 0x4002_0124 sc2tfc 0x4002_0134 0x4002_0105 0x4002_0115 0x4002_0125 0x4002_0135 0x4002_0106 0x4002_0116 0x4002_0126 0x4002_0136 0x4002_0107 0x4002_0117 0x4002_0127 0x4002_0137 0x4002_0108 sc2cr 0x4002_0118 sc2mod1 0x4002_0128 sc2rst 0x4002_0138 0x4002_0109 0x4002_0119 0x4002_0129 0x4002_0139 0x4002_010a 0x4002_011a 0x4002_012a 0x4002_013a 0x4002_010b 0x4002_011b 0x4002_012b 0x4002_013b 0x4002_010c sc2mod0 0x4002_011c sc2mod2 0x4002_012c sc2tst 0x4002_013c 0x4002_010d 0x4002_011d 0x4002_012d 0x4002_013d 0x4002_010e 0x4002_011e 0x4002_012e 0x4002_013e 0x4002_010f 0x4002_011f 0x4002_012f 0x4002_013f
tmpm380/m382 tmpm380/m382 - 13 / 49 - ? [5] serial interface (uart/sio) [2/2] address register name address register name address register name address register name 0x4002_0140 sc3en 0x4002_0150 sc3brcr 0x4002_0160 sc3rfc 0x4002_0170 sc3fcnf 0x4002_0141 0x4002_0151 0x4002_0161 0x4002_0171 0x4002_0142 0x4002_0152 0x4002_0162 0x4002_0172 0x4002_0143 0x4002_0153 0x4002_0163 0x4002_0173 0x4002_0144 sc3buf 0x4002_0154 sc3bradd 0x4002_0164 sc3tfc 0x4002_0174 0x4002_0145 0x4002_0155 0x4002_0165 0x4002_0175 0x4002_0146 0x4002_0156 0x4002_0166 0x4002_0176 0x4002_0147 0x4002_0157 0x4002_0167 0x4002_0177 0x4002_0148 sc3cr 0x4002_0158 sc3mod1 0x4002_0168 sc3rst 0x4002_0178 0x4002_0149 0x4002_0159 0x4002_0169 0x4002_0179 0x4002_014a 0x4002_015a 0x4002_016a 0x4002_017a 0x4002_014b 0x4002_015b 0x4002_016b 0x4002_017b 0x4002_014c sc3mod0 0x4002_015c sc3mod2 0x4002_016c sc3tst 0x4002_017c 0x4002_014d 0x4002_015d 0x4002_016d 0x4002_017d 0x4002_014e 0x4002_015e 0x4002_016e 0x4002_017e 0x4002_014f 0x4002_015f 0x4002_016f 0x4002_017f address register name address register name address register name address register name 0x4002_0180 sc4en 0x4002_0190 sc4brcr 0x4002_01a0 sc4rfc 0x4002_01b0 sc4fcnf 0x4002_0181 0x4002_0191 0x4002_01a1 0x4002_01b1 0x4002_0182 0x4002_0192 0x4002_01a2 0x4002_01b2 0x4002_0183 0x4002_0193 0x4002_01a3 0x4002_01b3 0x4002_0184 sc4buf 0x4002_0194 sc4bradd 0x4002_01a4 sc4tfc 0x4002_01b4 0x4002_0185 0x4002_0195 0x4002_01a5 0x4002_01b5 0x4002_0186 0x4002_0196 0x4002_01a6 0x4002_01b6 0x4002_0187 0x4002_0197 0x4002_01a7 0x4002_01b7 0x4002_0188 sc4cr 0x4002_0198 sc4mod1 0x4002_01a8 sc4rst 0x4002_01b8 0x4002_0189 0x4002_0199 0x4002_01a9 0x4002_01b9 0x4002_018a 0x4002_019a 0x4002_01aa 0x4002_01ba 0x4002_018b 0x4002_019b 0x4002_01ab 0x4002_01bb 0x4002_018c sc4mod0 0x4002_019c sc4mod2 0x4002_01ac sc4tst 0x4002_01bc 0x4002_018d 0x4002_019d 0x4002_01ad 0x4002_01bd 0x4002_018e 0x4002_019e 0x4002_01ae 0x4002_01be 0x4002_018f 0x4002_019f 0x4002_01af 0x4002_01bf
25 special function registers tmpm380/m382 tmpm380/m382 - 14 / 49 - 25.1.6 [6] 12-bit a/d converter (a/dc) [1/2] address register name address register name address register name address register name 0x4003_0000 adclk 0x4003_0010 adcmpcr0 0x4003_0020 adreg0 0x4003_0030 adreg4 0x4003_0001 0x4003_0011 0x4003_0021 0x4003_0031 0x4003_0002 0x4003_0012 0x4003_0022 0x4003_0032 0x4003_0003 0x4003_0013 0x4003_0023 0x4003_0033 0x4003_0004 admod0 0x4003_0014 adcmpcr1 0x4003_0024 adreg1 0x4003_0034 adreg5 0x4003_0005 0x4003_0015 0x4003_0025 0x4003_0035 0x4003_0006 0x4003_0016 0x4003_0026 0x4003_0036 0x4003_0007 0x4003_0017 0x4003_0027 0x4003_0037 0x4003_0008 admod1 0x4003_0018 adcmp0 0x4003_0028 adreg2 0x4003_0038 adreg6 0x4003_0009 0x4003_0019 0x4003_0029 0x4003_0039 0x4003_000a 0x4003_001a 0x4003_002a 0x4003_003a 0x4003_000b 0x4003_001b 0x4003_002b 0x4003_003b 0x4003_000c admod2 0x4003_001c adcmp1 0x4003_002c adreg3 0x4003_003c adreg7 0x4003_000d 0x4003_001d 0x4003_002d 0x4003_003d 0x4003_000e 0x4003_001e 0x4003_002e 0x4003_003e 0x4003_000f 0x4003_001f 0x4003_002f 0x4003_003f address register name address register name address register name address register name 0x4003_0040 adreg8 0x4003_0050 adpsel0 0x4003_0060 reserved 0x4003_0070 reserved 0x4003_0041 0x4003_0051 0x4003_0061 0x4003_0071 0x4003_0042 0x4003_0052 0x4003_0062 0x4003_0072 0x4003_0043 0x4003_0053 0x4003_0063 0x4003_0073 0x4003_0044 adreg9 0x4003_0054 adpsel1 0x4003_0064 reserved 0x4003_0074 reserved 0x4003_0045 0x4003_0055 0x4003_0065 0x4003_0075 0x4003_0046 0x4003_0056 0x4003_0066 0x4003_0076 0x4003_0047 0x4003_0057 0x4003_0067 0x4003_0077 0x4003_0048 adreg10 0x4003_0058 adpsel2 0x 4003_0068 reserved 0x4003_0078 reserved 0x4003_0049 0x4003_0059 0x4003_0069 0x4003_0079 0x4003_004a 0x4003_005a 0x4003_006a 0x4003_007a 0x4003_004b 0x4003_005b 0x4003_006b 0x4003_007b 0x4003_004c adreg11 0x4003_005c adpsel3 0x4003_006c reserved 0x4003_007c reserved 0x4003_004d 0x4003_005d 0x4003_006d 0x4003_007d 0x4003_004e 0x4003_005e 0x4003_006e 0x4003_007e 0x4003_004f 0x4003_005f 0x4003_006f 0x4003_007f address register name address register name address register name address register name 0x4003_0080 adpints0 0x4003_0090 adpints4 0x4003_00a0 adpset2 0x4003_00b0 adtset03 0x4003_0081 0x4003_0091 0x4003_00a1 0x4003_00b1 0x4003_0082 0x4003_0092 0x4003_00a2 0x4003_00b2 0x4003_0083 0x4003_0093 0x4003_00a3 0x4003_00b3 0x4003_0084 adpints1 0x4003_0094 adpints5 0x4003_00a4 adpset3 0x4003_00b4 adtset47 0x4003_0085 0x4003_0095 0x4003_00a5 0x4003_00b5 0x4003_0086 0x4003_0096 0x4003_00a6 0x4003_00b6 0x4003_0087 0x4003_0097 0x4003_00a7 0x4003_00b7 0x4003_0088 adpints2 0x4003_0098 adpset0 0x 4003_00a8 adpset4 0x4003_00b8 adtset811 0x4003_0089 0x4003_0099 0x4003_00a9 0x4003_00b9 0x4003_008a 0x4003_009a 0x4003_00aa 0x4003_00ba 0x4003_008b 0x4003_009b 0x4003_00ab 0x4003_00bb 0x4003_008c adpints3 0x4003_009c adpset 1 0x4003_00ac adpset5 0x4003_00bc adsset03 0x4003_008d 0x4003_009d 0x4003_00ad 0x4003_00bd 0x4003_008e 0x4003_009e 0x4003_00ae 0x4003_00be 0x4003_008f 0x4003_009f 0x4003_00af 0x4003_00bf
tmpm380/m382 tmpm380/m382 - 15 / 49 - ? [6] 12-bit a/d converter (a/dc) [2/2] address register name address register name address register name address register name 0x4003_00c0 adsset47 0x4003_00d0 ad aset811 0x4003_00e0 0x4003_00f0 0x4003_00c1 0x4003_00d1 0x4003_00e1 0x4003_00f1 0x4003_00c2 0x4003_00d2 0x4003_00e2 0x4003_00f2 0x4003_00c3 0x4003_00d3 0x4003_00e3 0x4003_00f3 0x4003_00c4 adsset811 0x4003_00d4 ad mod3 0x4003_00e4 0x4003_00f4 0x4003_00c5 0x4003_00d5 0x4003_00e5 0x4003_00f5 0x4003_00c6 0x4003_00d6 0x4003_00e6 0x4003_00f6 0x4003_00c7 0x4003_00d7 0x4003_00e7 0x4003_00f7 0x4003_00c8 adaset03 0x4003_00d8 0x4003_00e8 0x4003_00f8 0x4003_00c9 0x4003_00d9 0x4003_00e9 0x4003_00f9 0x4003_00ca 0x4003_00da 0x4003_00ea 0x4003_00fa 0x4003_00cb 0x4003_00db 0x4003_00eb 0x4003_00fb 0x4003_00cc adaset47 0x4003_00dc 0x4003_00ec 0x4003_00fc 0x4003_00cd 0x4003_00dd 0x4003_00ed 0x4003_00fd 0x4003_00ce 0x4003_00de 0x4003_00ee 0x4003_00fe 0x4003_00cf 0x4003_00df 0x4003_00ef 0x4003_00ff
25 special function registers tmpm380/m382 tmpm380/m382 - 16 / 49 - 25.1.7 [7] watchdog timer (wdt) address register name address register name address register name address register name 0x4004_0000 wdmod 0x4004_0010 0x4004_0020 0x4004_0030 0x4004_0001 0x4004_0011 0x4004_0021 0x4004_0031 0x4004_0002 0x4004_0012 0x4004_0022 0x4004_0032 0x4004_0003 0x4004_0013 0x4004_0023 0x4004_0033 0x4004_0004 wdcr 0x4004_0014 0x4004_0024 0x4004_0034 0x4004_0005 0x4004_0015 0x4004_0025 0x4004_0035 0x4004_0006 0x4004_0016 0x4004_0026 0x4004_0036 0x4004_0007 0x4004_0017 0x4004_0027 0x4004_0037 0x4004_0008 0x4004_0018 0x4004_0028 0x4004_0038 0x4004_0009 0x4004_0019 0x4004_0029 0x4004_0039 0x4004_000a 0x4004_001a 0x4004_002a 0x4004_003a 0x4004_000b 0x4004_001b 0x4004_002b 0x4004_003b 0x4004_000c 0x4004_001c 0x4004_002c 0x4004_003c 0x4004_000d 0x4004_001d 0x4004_002d 0x4004_003d 0x4004_000e 0x4004_001e 0x4004_002e 0x4004_003e 0x4004_000f 0x4004_001f 0x4004_002f 0x4004_003f 25.1.8 [8] real time clock (rtc) address register name address register name address register name address register name 0x4004_0100 secr 0x4004_0110 0x4004_0120 0x4004_0130 0x4004_0101 minr 0x4004_0111 0x4004_0121 0x4004_0131 0x4004_0102 hourr 0x4004_0112 0x4004_0122 0x4004_0132 0x4004_0103 0x4004_0113 0x4004_0123 0x4004_0133 0x4004_0104 dayr 0x4004_0114 0x4004_0124 0x4004_0134 0x4004_0105 dater 0x4004_0115 0x4004_0125 0x4004_0135 0x4004_0106 monthr 0x4004_0116 0x4004_0126 0x4004_0136 0x4004_0107 yearr 0x4004_0117 0x4004_0127 0x4004_0137 0x4004_0108 pager 0x4004_0118 0x4004_0128 0x4004_0138 0x4004_0109 0x4004_0119 0x4004_0129 0x4004_0139 0x4004_010a 0x4004_011a 0x4004_012a 0x4004_013a 0x4004_010b 0x4004_011b 0x4004_012b 0x4004_013b 0x4004_010c restr 0x4004_011c 0x4004_012c 0x4004_013c 0x4004_010d 0x4004_011d 0x4004_012d 0x4004_013d 0x4004_010e 0x4004_011e 0x4004_012e 0x4004_013e 0x4004_010f 0x4004_011f 0x4004_012f 0x4004_013f 25.1.9 [9] clock generator (cg) address register name address register name address register name address register name 0x4004_0200 cgsyscr 0x4004_0210 cgcksel 0x4004_0220 cg imcga 0x4004_0230 cgimcge 0x4004_0201 0x4004_0211 0x4004_0221 0x4004_0231 0x4004_0202 0x4004_0212 0x4004_0222 0x4004_0232 0x4004_0203 0x4004_0213 0x4004_0223 0x4004_0233 0x4004_0204 cgosccr 0x4004_0214 cgicrcg 0x4004_0224 cgimcgb 0x4004_0234 0x4004_0205 0x4004_0215 0x4004_0225 0x4004_0235 0x4004_0206 0x4004_0216 0x4004_0226 0x4004_0236 0x4004_0207 0x4004_0217 0x4004_0227 0x4004_0237 0x4004_0208 cgstbycr 0x4004_0218 cgnmiflg 0x4004_0228 cgimcgc 0x4004_0238 0x4004_0209 0x4004_0219 0x4004_0229 0x4004_0239 0x4004_020a 0x4004_021a 0x4004_022a 0x4004_023a 0x4004_020b 0x4004_021b 0x4004_022b 0x4004_023b 0x4004_020c cgpllsel 0x4004_021c cgrstflg 0x4004_022c cgimcgd 0x4004_023c 0x4004_020d 0x4004_021d 0x4004_022d 0x4004_023d 0x4004_020e 0x4004_021e 0x4004_022e 0x4004_023e 0x4004_020f 0x4004_021f 0x4004_022f 0x4004_023f
tmpm380/m382 tmpm380/m382 - 17 / 49 - ? 25.1.10 [10] remote control signal preprocessor (rmc) address register name address register name address register name address register name 0x4004_0400 rmcen 0x4004_0410 rmcrbuf3 0x4004_0420 rmccr4 0x4004_0430 rmcend3 0x4004_0401 0x4004_0411 0x4004_0421 0x4004_0431 0x4004_0402 0x4004_0412 0x4004_0422 0x4004_0432 0x4004_0403 0x4004_0413 0x4004_0423 0x4004_0433 0x4004_0404 rmcren 0x4004_0414 rmcrcr1 0x4004_0424 rmcrstat 0x4004_0434 rmcfssel 0x4004_0405 0x4004_0415 0x4004_0425 0x4004_0435 0x4004_0406 0x4004_0416 0x4004_0426 0x4004_0436 0x4004_0407 0x4004_0417 0x4004_0427 0x4004_0437 0x4004_0408 rmcrbuf1 0x4004_0418 rmcrcr2 0x4004_0428 rmcend1 0x4004_0438 0x4004_0409 0x4004_0419 0x4004_0429 0x4004_0439 0x4004_040a 0x4004_041a 0x4004_042a 0x4004_043a 0x4004_040b 0x4004_041b 0x4004_042b 0x4004_043b 0x4004_040c rmcrbuf2 0x4004_041c rmcrcr3 0x4004_042c rmcend2 0x4004_043c 0x4004_040d 0x4004_041d 0x4004_042d 0x4004_043d 0x4004_040e 0x4004_041e 0x4004_042e 0x4004_043e 0x4004_040f 0x4004_041f 0x4004_042f 0x4004_043f 25.1.11 [11] oscillation frequency detector (ofd) address register name address register name address register name address register name 0x4004_0800 ofdcr1 0x4004_0810 ofdmx 0x4004_0820 0x4004_0830 0x4004_0801 0x4004_0811 0x4004_0821 0x4004_0831 0x4004_0802 0x4004_0812 0x4004_0822 0x4004_0832 0x4004_0803 0x4004_0813 0x4004_0823 0x4004_0833 0x4004_0804 ofdcr2 0x4004_0814 0x4004_0824 0x4004_0834 0x4004_0805 0x4004_0815 0x4004_0825 0x4004_0835 0x4004_0806 0x4004_0816 0x4004_0826 0x4004_0836 0x4004_0807 0x4004_0817 0x4004_0827 0x4004_0837 0x4004_0808 ofdmn 0x4004_0818 ofdrst 0x4004_0828 0x4004_0838 0x4004_0809 0x4004_0819 0x4004_0829 0x4004_0839 0x4004_080a 0x4004_081a 0x4004_082a 0x4004_083a 0x4004_080b 0x4004_081b 0x4004_082b 0x4004_083b 0x4004_080c 0x4004_081c ofdstat 0x4004_082c 0x4004_083c 0x4004_080d 0x4004_081d 0x4004_082d 0x4004_083d 0x4004_080e 0x4004_081e 0x4004_082e 0x4004_083e 0x4004_080f 0x4004_081f 0x4004_082f 0x4004_083f 25.1.12 [12] power on reset (por), voltage detecting circuit (vltd) address register name address register name address register name address register name 0x4004_0900 vdcr 0x4004_0910 0x4004_0920 0x4004_0930 0x4004_0901 0x4004_0911 0x4004_0921 0x4004_0931 0x4004_0902 0x4004_0912 0x4004_0922 0x4004_0932 0x4004_0903 0x4004_0913 0x4004_0923 0x4004_0933 0x4004_0904 vdsr 0x4004_0914 0x4004_0924 0x4004_0934 0x4004_0905 0x4004_0915 0x4004_0925 0x4004_0935 0x4004_0906 0x4004_0916 0x4004_0926 0x4004_0936 0x4004_0907 0x4004_0917 0x4004_0927 0x4004_0937 0x4004_0908 0x4004_0918 0x4004_0928 0x4004_0938 0x4004_0909 0x4004_0919 0x4004_0929 0x4004_0939 0x4004_090a 0x4004_091a 0x4004_092a 0x4004_093a 0x4004_090b 0x4004_091b 0x4004_092b 0x4004_093b 0x4004_090c 0x4004_091c 0x4004_092c 0x4004_093c 0x4004_090d 0x4004_091d 0x4004_092d 0x4004_093d 0x4004_090e 0x4004_091e 0x4004_092e 0x4004_093e 0x4004_090f 0x4004_091f 0x4004_092f 0x4004_093f
25 special function registers tmpm380/m382 tmpm380/m382 - 18 / 49 - 25.1.13 [13] multi purpose timer (pmd)[1/2] address register name address register name address register name address register name 0x4005_0400 mtpd0mden 0x4005_0410 mtpd0mdcnt 0x4005_0420 mtpd0cmpw 0x4005_0430 mtpd0emgrel 0x4005_0401 0x4005_0411 0x4005_0421 0x4005_0431 0x4005_0402 0x4005_0412 0x4005_0422 0x4005_0432 0x4005_0403 0x4005_0413 0x4005_0423 0x4005_0433 0x4005_0404 mtpd0portmd 0x4005_0414 mtpd0mdprd 0x4005_0424 reserved 0x4005_0434 mtpd0emgcr 0x4005_0405 0x4005_0415 0x4005_0425 reserved 0x4005_0435 0x4005_0406 0x4005_0416 0x4005_0426 reserved 0x4005_0436 0x4005_0407 0x4005_0417 0x4005_0427 reserved 0x4005_0437 0x4005_0408 mtpd0mdcr 0x4005_0418 mtpd0cmpu 0x4005_0428 mtpd0mdout 0x4005_0438 mtpd0emgst 0x4005_0409 0x4005_0419 0x4005_0429 0x4005_0439 0x4005_040a 0x4005_041a 0x4005_042a 0x4005_043a 0x4005_040b 0x4005_041b 0x4005_042b 0x4005_043b 0x4005_040c mtpd0cntsta 0x4005_041c mtpd0cmpv 0x4005_042c mtpd0mdpot 0x4005_043c reserved 0x4005_040d 0x4005_041d 0x4005_042d 0x4005_043d reserved 0x4005_040e 0x4005_041e 0x4005_042e 0x4005_043e reserved 0x4005_040f 0x4005_041f 0x4005_042f 0x4005_043f reserved address register name address register name address register name address register name 0x4005_0440 reserved 0x4005_0450 reserved 0x4005_0460 reserved 0x4005_0470 reserved 0x4005_0441 reserved 0x4005_0451 reserved 0x4005_0461 reserved 0x4005_0471 0x4005_0442 reserved 0x4005_0452 reserved 0x4005_0462 reserved 0x4005_0472 0x4005_0443 reserved 0x4005_0453 reserved 0x4005_0463 reserved 0x4005_0473 0x4005_0444 mtpd0dtr 0x4005_0454 reserved 0x4005_0464 reserved 0x4005_0474 reserved 0x4005_0445 0x4005_0455 reserved 0x4005_0465 0x4005_0475 0x4005_0446 0x4005_0456 reserved 0x4005_0466 0x4005_0476 0x4005_0447 0x4005_0457 reserved 0x4005_0467 0x4005_0477 0x4005_0448 mtpd0trgcmp0 0x4005_0458 mtpd0trgcr 0x4005_0468 reserved 0x4005_0478 reserved 0x4005_0449 0x4005_0459 0x4005_0469 0x4005_0479 0x4005_044a 0x4005_045a 0x4005_046a 0x4005_047a 0x4005_044b 0x4005_045b 0x4005_046b 0x4005_047b 0x4005_044c mtpd0trgcmp1 0x4005_045c mtpd0trgmd 0x4005_046c reserved 0x4005_047c reserved 0x4005_044d 0x4005_045d 0x4005_046d 0x4005_047d 0x4005_044e 0x4005_045e 0x4005_046e 0x4005_047e 0x4005_044f 0x4005_045f 0x4005_046f 0x4005_047f
tmpm380/m382 tmpm380/m382 - 19 / 49 - ? [13] multi purpose timer (pmd) [2/2] address register name address register name address register name address register name 0x4005_0480 mtpd1mden 0x4005_0490 mtpd1mdcnt 0x4005_04a0 mtpd1cmpw 0x4005_04b0 mtpd1emgrel 0x4005_0481 0x4005_0491 0x4005_04a1 0x4005_04b1 0x4005_0482 0x4005_0492 0x4005_04a2 0x4005_04b2 0x4005_0483 0x4005_0493 0x4005_04a3 0x4005_04b3 0x4005_0484 mtpd1portmd 0x4005_0494 mtpd1mdprd 0x4005_04a4 reserved 0x4005_04b4 mtpd1emgcr 0x4005_0485 0x4005_0495 0x4005_04a5 reserved 0x4005_04b5 0x4005_0486 0x4005_0496 0x4005_04a6 reserved 0x4005_04b6 0x4005_0487 0x4005_0497 0x4005_04a7 reserved 0x4005_04b7 0x4005_0488 mtpd1mdcr 0x4005_0498 mtpd1cmpu 0x4005_04a8 mtpd1mdout 0x4005_04b8 mtpd1emgst 0x4005_0489 0x4005_0499 0x4005_04a9 0x4005_04b9 0x4005_048a 0x4005_049a 0x4005_04aa 0x4005_04ba 0x4005_048b 0x4005_049b 0x4005_04ab 0x4005_04bb 0x4005_048c mtpd1cntsta 0x4005_049c mtpd1cmpv 0x4005_04ac mtpd1mdpot 0x4005_04bc reserved 0x4005_048d 0x4005_049d 0x4005_04ad 0x4005_04bd 0x4005_048e 0x4005_049e 0x4005_04ae 0x4005_04be 0x4005_048f 0x4005_049f 0x4005_04af 0x4005_04bf address register name address register name address register name address register name 0x4005_04c0 reserved 0x4005_04d0 reserved 0x4005_04e0 reserved 0x4005_04f0 reserved 0x4005_04c1 0x4005_04d1 0x4005_04e1 0x4005_04f1 0x4005_04c2 0x4005_04d2 0x4005_04e2 0x4005_04f2 0x4005_04c3 0x4005_04d3 0x4005_04e3 0x4005_04f3 0x4005_04c4 mtpd1tr 0x4005_04d4 reserved 0x4005_04e4 reserved 0x4005_04f4 reserved 0x4005_04c5 0x4005_04d5 0x4005_04e5 0x4005_04f5 0x4005_04c6 0x4005_04d6 0x4005_04e6 0x4005_04f6 0x4005_04c7 0x4005_04d7 0x4005_04e7 0x4005_04f7 0x4005_04c8 mtpd1trgcmp0 0x4005_04d8 mtpd1trgcr 0x4005_04e8 reserved 0x4005_04f8 reserved 0x4005_04c9 0x4005_04d9 0x4005_04e9 0x4005_04f9 0x4005_04ca 0x4005_04da 0x4005_04ea 0x4005_04fa 0x4005_04cb 0x4005_04db 0x4005_04eb 0x4005_04fb 0x4005_04cc mtpd1trgcmp1 0x4005_04dc mtpd1trgmd 0x4005_04ec reserved 0x4005_04fc reserved 0x4005_04cd 0x4005_04dd 0x4005_04ed 0x4005_04fd 0x4005_04ce 0x4005_04de 0x4005_04ee 0x4005_04fe 0x4005_04cf 0x4005_04df 0x4005_04ef 0x4005_04ff
25 special function registers tmpm380/m382 tmpm380/m382 - 20 / 49 - [13] multi purpose timer (tmr/igbt) [1/3] address register name address register name address register name address register name 0x4005_0800 mt0en 0x4005_0810 mt0tbffcr 0x4005_0820 mt0rg0 0x4005_0830 mt0igcr 0x4005_0801 0x4005_0811 0x4005_0821 0x4005_0831 0x4005_0802 0x4005_0812 0x4005_0822 0x4005_0832 0x4005_0803 0x4005_0813 0x4005_0823 0x4005_0833 0x4005_0804 mt0run 0x4005_0814 mt0tbst 0x4005_0824 mt0rg1 0x4005_0834 mt0igresta 0x4005_0805 0x4005_0815 0x4005_0825 0x4005_0835 0x4005_0806 0x4005_0816 0x4005_0826 0x4005_0836 0x4005_0807 0x4005_0817 0x4005_0827 0x4005_0837 0x4005_0808 mt0tbcr 0x4005_0818 mt0tbim 0x4005_0828 mt0cp0 0x4005_0838 mt0igst 0x4005_0809 0x4005_0819 0x4005_0829 0x4005_0839 0x4005_080a 0x4005_081a 0x4005_082a 0x4005_083a 0x4005_080b 0x4005_081b 0x4005_082b 0x4005_083b 0x4005_080c mt0tbmod 0x4005_081c mt0tbuc 0x4005_082c mt0cp1 0x4005_083c mt0igicr 0x4005_080d 0x4005_081d 0x4005_082d 0x4005_083d 0x4005_080e 0x4005_081e 0x4005_082e 0x4005_083e 0x4005_080f 0x4005_081f 0x4005_082f 0x4005_083f address register name address register name address register name address register name 0x4005_0840 mt0igocr 0x4005_0850 mt0igemgcr 0x4005_0860 reserved 0x4005_0870 reserved 0x4005_0841 0x4005_0851 0x4005_0861 0x4005_0871 0x4005_0842 0x4005_0852 0x4005_0862 0x4005_0872 0x4005_0843 0x4005_0853 0x4005_0863 0x4005_0873 0x4005_0844 mt0igrg2 0x4005_0854 mt0igemgst 0x4005_0864 reserved 0x4005_0874 reserved 0x4005_0845 0x4005_0855 0x4005_0865 0x4005_0875 0x4005_0846 0x4005_0856 0x4005_0866 0x4005_0876 0x4005_0847 0x4005_0857 0x4005_0867 0x4005_0877 0x4005_0848 mt0igrg3 0x4005_0858 reserved 0x4005_0868 reserved 0x4005_0878 reserved 0x4005_0849 0x4005_0859 0x4005_0869 0x4005_0879 0x4005_084a 0x4005_085a 0x4005_086a 0x4005_087a 0x4005_084b 0x4005_085b 0x4005_086b 0x4005_087b 0x4005_084c mt0igrg4 0x4005_085c reserv ed 0x4005_086c reserved 0x4005_087c reserved 0x4005_084d 0x4005_085d 0x4005_086d 0x4005_087d 0x4005_084e 0x4005_085e 0x4005_086e 0x4005_087e 0x4005_084f 0x4005_085f 0x4005_086f 0x4005_087f
tmpm380/m382 tmpm380/m382 - 21 / 49 - ? [13] multi purpose timer (tmr/igbt) [2/3] address register name address register name address register name address register name 0x4005_0880 mt1en 0x4005_0890 mt1tbffcr 0x4005_08a0 mt1rg0 0x4005_08b0 mt1igcr 0x4005_0881 0x4005_0891 0x4005_08a1 0x4005_08b1 0x4005_0882 0x4005_0892 0x4005_08a2 0x4005_08b2 0x4005_0883 0x4005_0893 0x4005_08a3 0x4005_08b3 0x4005_0884 mt1run 0x4005_0894 mt1tbst 0x4005_08a4 mt1rg1 0x4005_08b4 mt1igresta 0x4005_0885 0x4005_0895 0x4005_08a5 0x4005_08b5 0x4005_0886 0x4005_0896 0x4005_08a6 0x4005_08b6 0x4005_0887 0x4005_0897 0x4005_08a7 0x4005_08b7 0x4005_0888 mt1tbcr 0x4005_0898 mt1tbim 0x4005_08a8 mt1cp0 0x4005_08b8 mt1igst 0x4005_0889 0x4005_0899 0x4005_08a9 0x4005_08b9 0x4005_088a 0x4005_089a 0x4005_08aa 0x4005_08ba 0x4005_088b 0x4005_089b 0x4005_08ab 0x4005_08bb 0x4005_088c mt1tbmod 0x4005_089c mt11uc 0x4005_08ac mt1cp1 0x4005_08bc mt1igicr 0x4005_088d 0x4005_089d 0x4005_08ad 0x4005_08bd 0x4005_088e 0x4005_089e 0x4005_08ae 0x4005_08be 0x4005_088f 0x4005_089f 0x4005_08af 0x4005_08bf address register name address register name address register name address register name 0x4005_08c0 mt1igocr 0x4005_08d0 mt1igemgcr 0x4005_08e0 reserved 0x4005_08f0 reserved 0x4005_08c1 0x4005_08d1 0x4005_08e1 0x4005_08f1 0x4005_08c2 0x4005_08d2 0x4005_08e2 0x4005_08f2 0x4005_08c3 0x4005_08d3 0x4005_08e3 0x4005_08f3 0x4005_08c4 mt1igrg2 0x4005_08d4 mt1igemgst 0x4005_08e4 reserved 0x4005_08f4 reserved 0x4005_08c5 0x4005_08d5 0x4005_08e5 0x4005_08f5 0x4005_08c6 0x4005_08d6 0x4005_08e6 0x4005_08f6 0x4005_08c7 0x4005_08d7 0x4005_08e7 0x4005_08f7 0x4005_08c8 mt1igrg3 0x4005_08d8 reserved 0x4005_08e8 reserved 0x4005_08f8 reserved 0x4005_08c9 0x4005_08d9 0x4005_08e9 0x4005_08f9 0x4005_08ca 0x4005_08da 0x4005_08ea 0x4005_08fa 0x4005_08cb 0x4005_08db 0x4005_08eb 0x4005_08fb 0x4005_08cc mt1igrg4 0x4005_08dc reserved 0x4005_08ec reserved 0x4005_08fc reserved 0x4005_08cd 0x4005_08dd 0x4005_08ed 0x4005_08fd 0x4005_08ce 0x4005_08de 0x4005_08ee 0x4005_08fe 0x4005_08cf 0x4005_08df 0x4005_08ef 0x4005_08ff
25 special function registers tmpm380/m382 tmpm380/m382 - 22 / 49 - [13] multi purpose timer (tmr/igbt) [3/3] address register name address register name address register name address register name 0x4005_0900 mt2en 0x4005_0910 mt2tbffcr 0x4005_0920 mt2rg0 0x4005_0930 mt2igcr 0x4005_0901 0x4005_0911 0x4005_0921 0x4005_0931 0x4005_0902 0x4005_0912 0x4005_0922 0x4005_0932 0x4005_0903 0x4005_0913 0x4005_0923 0x4005_0933 0x4005_0904 mt2run 0x4005_0914 mt2tbst 0x4005_0924 mt2rg1 0x4005_0934 mt2igresta 0x4005_0905 0x4005_0915 0x4005_0925 0x4005_0935 0x4005_0906 0x4005_0916 0x4005_0926 0x4005_0936 0x4005_0907 0x4005_0917 0x4005_0927 0x4005_0937 0x4005_0908 mt2tbcr 0x4005_0918 mt2tbim 0x4005_0928 mt2cp0 0x4005_0938 mt2igst 0x4005_0909 0x4005_0919 0x4005_0929 0x4005_0939 0x4005_090a 0x4005_091a 0x4005_092a 0x4005_093a 0x4005_090b 0x4005_091b 0x4005_092b 0x4005_093b 0x4005_090c mt2tbmod 0x4005_091c mt2tbuc 0x4005_092c mt2cp1 0x4005_093c mt2igicr 0x4005_090d 0x4005_091d 0x4005_092d 0x4005_093d 0x4005_090e 0x4005_091e 0x4005_092e 0x4005_093e 0x4005_090f 0x4005_091f 0x4005_092f 0x4005_093f address register name address register name address register name address register name 0x4005_0940 mt2igocr 0x4005_0950 mt2igemgcr 0x4005_0960 reserved 0x4005_0970 reserved 0x4005_0941 0x4005_0951 0x4005_0961 0x4005_0971 0x4005_0942 0x4005_0952 0x4005_0962 0x4005_0972 0x4005_0943 0x4005_0953 0x4005_0963 0x4005_0973 0x4005_0944 mt2igrg2 0x4005_0954 mt2igemgst 0x4005_0964 reserved 0x4005_0974 reserved 0x4005_0945 0x4005_0955 0x4005_0965 0x4005_0975 0x4005_0946 0x4005_0956 0x4005_0966 0x4005_0976 0x4005_0947 0x4005_0957 0x4005_0967 0x4005_0977 0x4005_0948 mt2igrg3 0x4005_0958 reserved 0x4005_0968 reserved 0x4005_0978 reserved 0x4005_0949 0x4005_0959 0x4005_0969 0x4005_0979 0x4005_094a 0x4005_095a 0x4005_096a 0x4005_097a 0x4005_094b 0x4005_095b 0x4005_096b 0x4005_097b 0x4005_094c mt2igrg4 0x4005_095c reserv ed 0x4005_096c reserved 0x4005_097c reserved 0x4005_094d 0x4005_095d 0x4005_096d 0x4005_097d 0x4005_094e 0x4005_095e 0x4005_096e 0x4005_097e 0x4005_094f 0x4005_095f 0x4005_096f 0x4005_097f
tmpm380/m382 tmpm380/m382 - 23 / 49 - ? 25.1.14 [15] dma controller (dmac) address register name address register name address register name address register name 0x4008_0000 dmacint 0x4008_0010 dmacint 0x4008_0020 dmacsoftb 0x4008_0030 dmac 0x4008_0001 status 0x4008_0011 errclr 0x4008_0021 req 0x4008_0031 configuration 0x4008_0002 0x4008_0012 0x4008_0022 0x4008_0032 0x4008_0003 0x4008_0013 0x4008_0023 0x4008_0033 0x4008_0004 dmacinttc 0x4008_0014 dmacrawint 0x4008_0024 dmacsofts 0x4008_0034 reserved 0x4008_0005 status 0x4008_0015 tcstatus 0x4008_0025 req 0x4008_0035 0x4008_0006 0x4008_0016 0x4008_0026 0x4008_0036 0x4008_0007 0x4008_0017 0x4008_0027 0x4008_0037 0x4008_0008 dmacinttc 0x4008_0018 dmacrawint 0x4008_0028 reserved 0x4008_0038 reserved 0x4008_0009 clear 0x4008_0019 errorstatus 0x4008_0029 0x4008_0039 0x4008_000a 0x4008_001a 0x4008_002a 0x4008_003a 0x4008_000b 0x4008_001b 0x4008_002b 0x4008_003b 0x4008_000c dmacint 0x4008_001c dmacenbld 0x4008_002c reserved 0x4008_003c reserved 0x4008_000d errorstatus 0x4008_001d chns 0x4008_002d 0x4008_003d 0x4008_000e 0x4008_001e 0x4008_002e 0x4008_003e 0x4008_000f 0x4008_001f 0x4008_002f 0x4008_003f address register name address register name address register name address register name 0x4008_0100 dmacc0src 0x4008_0110 dmacc0 0x4008_0120 dmacc1src 0x4008_0130 dmacc1 0x4008_0101 addr 0x4008_0111 configuratio n 0x4008_0121 addr 0x4008_0131 configuration 0x4008_0102 0x4008_0112 0x4008_0122 0x4008_0132 0x4008_0103 0x4008_0113 0x4008_0123 0x4008_0133 0x4008_0104 dmacc0dest 0x4008_0114 reserved 0x4008_0124 dmacc1dest 0x4008_0134 reserved 0x4008_0105 addr 0x4008_0115 0x4008_0125 addr 0x4008_0135 0x4008_0106 0x4008_0116 0x4008_0126 0x4008_0136 0x4008_0107 0x4008_0117 0x4008_0127 0x4008_0137 0x4008_0108 dmacc0lli 0x4008_0118 reserved 0x4008_0128 dmacc1lli 0x4008_0138 reserved 0x4008_0109 0x4008_0119 0x4008_0129 0x4008_0139 0x4008_010a 0x4008_011a 0x4008_012a 0x4008_013a 0x4008_010b 0x4008_011b 0x4008_012b 0x4008_013b 0x4008_010c dmacc0 0x4008_011c reserved 0x4008_012c dmacc1 0x4008_013c reserved 0x4008_010d control 0x4008_011d 0x4008_012d control 0x4008_013d 0x4008_010e 0x4008_011e 0x4008_012e 0x4008_013e 0x4008_010f 0x4008_011f 0x4008_012f 0x4008_013f
25 special function registers tmpm380/m382 tmpm380/m382 - 24 / 49 - 25.1.15 [15] ssp controller address register name address register name address register name address register name 0x400c_0000 ssp0cr0 0x400c_0010 ssp0cpsr 0x400c_0020 ssp0icr 0x400c_0030 reserved 0x400c_0001 0x400c_0011 0x400c_0021 0x400c_0031 0x400c_0002 0x400c_0012 0x400c_0022 0x400c_0032 0x400c_0003 0x400c_0013 0x400c_0023 0x400c_0033 0x400c_0004 ssp0cr1 0x400c_0014 ssp0imsc 0x 400c_0024 ssp0dmacr 0x400c_0034 reserved 0x400c_0005 0x400c_0015 0x400c_0025 0x400c_0035 0x400c_0006 0x400c_0016 0x400c_0026 0x400c_0036 0x400c_0007 0x400c_0017 0x400c_0027 0x400c_0037 0x400c_0008 ssp0dr 0x400c_0018 ssp0ris 0x400c_0028 reserved 0x400c_0038 reserved 0x400c_0009 0x400c_0019 0x400c_0029 0x400c_0039 0x400c_000a 0x400c_001a 0x400c_002a 0x400c_003a 0x400c_000b 0x400c_001b 0x400c_002b 0x400c_003b 0x400c_000c ssp0sr 0x400c_001c ssp0mis 0x400c_002c reserved 0x400c_003c reserved 0x400c_000d 0x400c_001d 0x400c_002d 0x400c_003d 0x400c_000e 0x400c_001e 0x400c_002e 0x400c_003e 0x400c_000f 0x400c_001f 0x400c_002f 0x400c_003f address register name address register name address register name address register name 0x400c_1000 ssp1cr0 0x400c_1010 ssp1cpsr 0x400c_1020 ssp1icr 0x400c_1030 reserved 0x400c_1001 0x400c_1011 0x400c_1021 0x400c_1031 0x400c_1002 0x400c_1012 0x400c_1022 0x400c_1032 0x400c_1003 0x400c_1013 0x400c_1023 0x400c_1033 0x400c_1004 ssp1cr1 0x400c_1014 ssp1imsc 0x 400c_1024 ssp1dmacr 0x400c_1034 reserved 0x400c_1005 0x400c_1015 0x400c_1025 0x400c_1035 0x400c_1006 0x400c_1016 0x400c_1026 0x400c_1036 0x400c_1007 0x400c_1017 0x400c_1027 0x400c_1037 0x400c_1008 ssp1dr 0x400c_1018 ssp1ris 0x400c_1028 reserved 0x400c_1038 reserved 0x400c_1009 0x400c_1019 0x400c_1029 0x400c_1039 0x400c_100a 0x400c_101a 0x400c_102a 0x400c_103a 0x400c_100b 0x400c_101b 0x400c_102b 0x400c_103b 0x400c_100c ssp1sr 0x400c_101c ssp1mis 0x400c_102c reserved 0x400c_103c reserved 0x400c_100d 0x400c_101d 0x400c_102d 0x400c_103d 0x400c_100e 0x400c_101e 0x400c_102e 0x400c_103e 0x400c_100f 0x400c_101f 0x400c_102f 0x400c_103f
tmpm380/m382 tmpm380/m382 - 25 / 49 - ? 25.1.16 [16] flash controller address register name address register name address register name address register name 0x41ff_f000 reserved 0x41ff_f010 fcsecbit 0x41ff_f020 fcflcs 0x41ff_f030 reserved 0x41ff_f001 0x41ff_f011 0x41ff_f021 0x41ff_f031 0x41ff_f002 0x41ff_f012 0x41ff_f022 0x41ff_f032 0x41ff_f003 0x41ff_f013 0x41ff_f023 0x41ff_f033 0x41ff_f004 reserved 0x41ff_f014 reserved 0x41ff_f024 reserved 0x41ff_f034 reserved 0x41ff_f005 0x41ff_f015 0x41ff_f025 0x41ff_f035 0x41ff_f006 0x41ff_f016 0x41ff_f026 0x41ff_f036 0x41ff_f007 0x41ff_f017 0x41ff_f027 0x41ff_f037 0x41ff_f008 reserved 0x41ff_f018 reserved 0x41ff_f028 reserved 0x41ff_f038 reserved 0x41ff_f009 0x41ff_f019 0x41ff_f029 0x41ff_f039 0x41ff_f00a 0x41ff_f01a 0x41ff_f02a 0x41ff_f03a 0x41ff_f00b 0x41ff_f01b 0x41ff_f02b 0x41ff_f03b 0x41ff_f00c reserved 0x41ff_f01c reserved 0x41ff_f02c reserved 0x41ff_f03c reserved 0x41ff_f00d 0x41ff_f01d 0x41ff_f02d 0x41ff_f03d 0x41ff_f00e 0x41ff_f01e 0x41ff_f02e 0x41ff_f03e 0x41ff_f00f 0x41ff_f01f 0x41ff_f02f 0x41ff_f03f address register name address register name address register name address register name 0x41ff_f040 reserved 0x41ff_f050 reserved 0x41ff_f060 reserved 0x41ff_f070 reserved 0x41ff_f041 0x41ff_f051 0x41ff_f061 0x41ff_f071 0x41ff_f042 0x41ff_f052 0x41ff_f062 0x41ff_f072 0x41ff_f043 0x41ff_f053 0x41ff_f063 0x41ff_f073 0x41ff_f044 reserved 0x41ff_f054 reserved 0x41ff_f064 reserved 0x41ff_f074 reserved 0x41ff_f045 0x41ff_f055 0x41ff_f065 0x41ff_f075 0x41ff_f046 0x41ff_f056 0x41ff_f066 0x41ff_f076 0x41ff_f047 0x41ff_f057 0x41ff_f067 0x41ff_f077 0x41ff_f048 reserved 0x41ff_f058 reserved 0x41ff_f068 reserved 0x41ff_f078 reserved 0x41ff_f049 0x41ff_f059 0x41ff_f069 0x41ff_f079 0x41ff_f04a 0x41ff_f05a 0x41ff_f06a 0x41ff_f07a 0x41ff_f04b 0x41ff_f05b 0x41ff_f06b 0x41ff_f07b 0x41ff_f04c reserved 0x41ff_f05c reserved 0x41ff_f06c reserved 0x41ff_f07c reserved 0x41ff_f04d 0x41ff_f05d 0x41ff_f06d 0x41ff_f07d 0x41ff_f04e 0x41ff_f05e 0x41ff_f06e 0x41ff_f07e 0x41ff_f04f 0x41ff_f05f 0x41ff_f06f 0x41ff_f07f address register name address register name address register name address register name 0x41ff_f080 reserved 0x41ff_f090 reserved 0x41ff_f0a0 reserved 0x41ff_f0b0 reserved 0x41ff_f081 0x41ff_f091 0x41ff_f0a1 0x41ff_f0b1 0x41ff_f082 0x41ff_f092 0x41ff_f0a2 0x41ff_f0b2 0x41ff_f083 0x41ff_f093 0x41ff_f0a3 0x41ff_f0b3 0x41ff_f084 reserved 0x41ff_f094 reserved 0x41ff_f0a4 reserved 0x41ff_f0b4 reserved 0x41ff_f085 0x41ff_f095 0x41ff_f0a5 0x41ff_f0b5 0x41ff_f086 0x41ff_f096 0x41ff_f0a6 0x41ff_f0b6 0x41ff_f087 0x41ff_f097 0x41ff_f0a7 0x41ff_f0b7 0x41ff_f088 reserved 0x41ff_f098 reserved 0x41ff_f0a8 reserved 0x41ff_f0b8 reserved 0x41ff_f089 0x41ff_f099 0x41ff_f0a9 0x41ff_f0b9 0x41ff_f08a 0x41ff_f09a 0x41ff_f0aa 0x41ff_f0ba 0x41ff_f08b 0x41ff_f09b 0x41ff_f0ab 0x41ff_f0bb 0x41ff_f08c reserved 0x41ff_f09c reserved 0x41ff_f0ac reserved 0x41ff_f0bc reserved 0x41ff_f08d 0x41ff_f09d 0x41ff_f0ad 0x41ff_f0bd 0x41ff_f08e 0x41ff_f09e 0x41ff_f0ae 0x41ff_f0be 0x41ff_f08f 0x41ff_f09f 0x41ff_f0af 0x41ff_f0bf
25 special function registers tmpm380/m382 tmpm380/m382 - 26 / 49 - 25.2 addresses for tmpm382 25.2.1 [1] port [1/5] address register name address register name address register name address register name 0x4000_0000 padata 0x4000_0010 0x4000_0020 0x4000_0030 papdn 0x4000_0001 0x4000_0011 0x4000_0021 0x4000_0031 0x4000_0002 0x4000_0012 0x4000_0022 0x4000_0032 0x4000_0003 0x4000_0013 0x4000_0023 0x4000_0033 0x4000_0004 pacr 0x4000_0014 0x4000_0024 0x4000_0034 0x4000_0005 0x4000_0015 0x4000_0025 0x4000_0035 0x4000_0006 0x4000_0016 0x4000_0026 0x4000_0036 0x4000_0007 0x4000_0017 0x4000_0027 0x4000_0037 0x4000_0008 pafr1 0x4000_0018 0x4000_0028 paod 0x4000_0038 paie 0x4000_0009 0x4000_0019 0x4000_0029 0x4000_0039 0x4000_000a 0x4000_001a 0x4000_002a 0x4000_003a 0x4000_000b 0x4000_001b 0x4000_002b 0x4000_003b 0x4000_000c pafr2 0x4000_001c 0x4000_002c papup 0x4000_003c 0x4000_000d 0x4000_001d 0x4000_002d 0x4000_003d 0x4000_000e 0x4000_001e 0x4000_002e 0x4000_003e 0x4000_000f 0x4000_001f 0x4000_002f 0x4000_003f address register name address register name address register name address register name 0x4000_0040 pbdata 0x4000_0050 0x4000_0060 0x4000_0070 pbpdn 0x4000_0041 0x4000_0051 0x4000_0061 0x4000_0071 0x4000_0042 0x4000_0052 0x4000_0062 0x4000_0072 0x4000_0043 0x4000_0053 0x4000_0063 0x4000_0073 0x4000_0044 pbcr 0x4000_0054 0x4000_0064 0x4000_0074 0x4000_0045 0x4000_0055 0x4000_0065 0x4000_0075 0x4000_0046 0x4000_0056 0x4000_0066 0x4000_0076 0x4000_0047 0x4000_0057 0x4000_0067 0x4000_0077 0x4000_0048 pbfr1 0x4000_0058 0x4000_0068 pbod 0x4000_0078 pbie 0x4000_0049 0x4000_0059 0x4000_0069 0x4000_0079 0x4000_004a 0x4000_005a 0x4000_006a 0x4000_007a 0x4000_004b 0x4000_005b 0x4000_006b 0x4000_007b 0x4000_004c 0x4000_005c 0x4000_006c pbpup 0x4000_007c 0x4000_004d 0x4000_005d 0x4000_006d 0x4000_007d 0x4000_004e 0x4000_005e 0x4000_006e 0x4000_007e 0x4000_004f 0x4000_005f 0x4000_006f 0x4000_007f address register name address register name address register name address register name 0x4000_0080 pcdata 0x4000_0090 pcfr3 0x4000_00a0 0x4000_00b0 pcpdn 0x4000_0081 0x4000_0091 0x4000_00a1 0x4000_00b1 0x4000_0082 0x4000_0092 0x4000_00a2 0x4000_00b2 0x4000_0083 0x4000_0093 0x4000_00a3 0x4000_00b3 0x4000_0084 pccr 0x4000_0094 pcfr4 0x4000_00a4 0x4000_00b4 0x4000_0085 0x4000_0095 0x4000_00a5 0x4000_00b5 0x4000_0086 0x4000_0096 0x4000_00a6 0x4000_00b6 0x4000_0087 0x4000_0097 0x4000_00a7 0x4000_00b7 0x4000_0088 pcfr1 0x4000_0098 pcfr5 0x4000_00a8 pcod 0x4000_00b8 pcie 0x4000_0089 0x4000_0099 0x4000_00a9 0x4000_00b9 0x4000_008a 0x4000_009a 0x4000_00aa 0x4000_00ba 0x4000_008b 0x4000_009b 0x4000_00ab 0x4000_00bb 0x4000_008c pcfr2 0x4000_009c 0x4000_00ac pcpup 0x4000_00bc 0x4000_008d 0x4000_009d 0x4000_00ad 0x4000_00bd 0x4000_008e 0x4000_009e 0x4000_00ae 0x4000_00be 0x4000_008f 0x4000_009f 0x4000_00af 0x4000_00bf
tmpm380/m382 tmpm380/m382 - 27 / 49 - ? [1] port [2/5] address register name address register name address register name address register name 0x4000_00c0 reserved 0x4000_00d0 reserved 0x4000_00e0 0x4000_00f0 reserved 0x4000_00c1 0x4000_00d1 0x4000_00e1 0x4000_00f1 0x4000_00c2 0x4000_00d2 0x4000_00e2 0x4000_00f2 0x4000_00c3 0x4000_00d3 0x4000_00e3 0x4000_00f3 0x4000_00c4 reserved 0x4000_00d4 0x4000_00e4 0x4000_00f4 0x4000_00c5 0x4000_00d5 0x4000_00e5 0x4000_00f5 0x4000_00c6 0x4000_00d6 0x4000_00e6 0x4000_00f6 0x4000_00c7 0x4000_00d7 0x4000_00e7 0x4000_00f7 0x4000_00c8 reserved 0x4000_00d8 0x4000_00e8 reserved 0x4000_00f8 reserved 0x4000_00c9 0x4000_00d9 0x4000_00e9 0x4000_00f9 0x4000_00ca 0x4000_00da 0x4000_00ea 0x4000_00fa 0x4000_00cb 0x4000_00db 0x4000_00eb 0x4000_00fb 0x4000_00cc reserved 0x4000_00dc 0x4000_00ec reserved 0x4000_00fc 0x4000_00cd 0x4000_00dd 0x4000_00ed 0x4000_00fd 0x4000_00ce 0x4000_00de 0x4000_00ee 0x4000_00fe 0x4000_00cf 0x4000_00df 0x4000_00ef 0x4000_00ff address register name address register name address register name address register name 0x4000_0100 pedata 0x4000_0110 0x4000_0120 0x4000_0130 pepdn 0x4000_0101 0x4000_0111 0x4000_0121 0x4000_0131 0x4000_0102 0x4000_0112 0x4000_0122 0x4000_0132 0x4000_0103 0x4000_0113 0x4000_0123 0x4000_0133 0x4000_0104 pecr 0x4000_0114 0x4000_0124 0x4000_0134 0x4000_0105 0x4000_0115 0x4000_0125 0x4000_0135 0x4000_0106 0x4000_0116 0x4000_0126 0x4000_0136 0x4000_0107 0x4000_0117 0x4000_0127 0x4000_0137 0x4000_0108 pefr1 0x4000_0118 0x4000_0128 peod 0x4000_0138 peie 0x4000_0109 0x4000_0119 0x4000_0129 0x4000_0139 0x4000_010a 0x4000_011a 0x4000_012a 0x4000_013a 0x4000_010b 0x4000_011b 0x4000_012b 0x4000_013b 0x4000_010c pefr2 0x4000_011c 0x4000_012c pepup 0x4000_013c 0x4000_010d 0x4000_011d 0x4000_012d 0x4000_013d 0x4000_010e 0x4000_011e 0x4000_012e 0x4000_013e 0x4000_010f 0x4000_011f 0x4000_012f 0x4000_013f address register name address register name address register name address register name 0x4000_0140 pfdata 0x4000_0150 pffr3 0x4000_0160 0x4000_0170 pfpdn 0x4000_0141 0x4000_0151 0x4000_0161 0x4000_0171 0x4000_0142 0x4000_0152 0x4000_0162 0x4000_0172 0x4000_0143 0x4000_0153 0x4000_0163 0x4000_0173 0x4000_0144 pfcr 0x4000_0154 0x4000_0164 0x4000_0174 0x4000_0145 0x4000_0155 0x4000_0165 0x4000_0175 0x4000_0146 0x4000_0156 0x4000_0166 0x4000_0176 0x4000_0147 0x4000_0157 0x4000_0167 0x4000_0177 0x4000_0148 pffr1 0x4000_0158 0x4000_0168 pfod 0x4000_0178 pfie 0x4000_0149 0x4000_0159 0x4000_0169 0x4000_0179 0x4000_014a 0x4000_015a 0x4000_016a 0x4000_017a 0x4000_014b 0x4000_015b 0x4000_016b 0x4000_017b 0x4000_014c pffr2 0x4000_015c 0x4000_016c pfpup 0x4000_017c 0x4000_014d 0x4000_015d 0x4000_016d 0x4000_017d 0x4000_014e 0x4000_015e 0x4000_016e 0x4000_017e 0x4000_014f 0x4000_015f 0x4000_016f 0x4000_017f
25 special function registers tmpm380/m382 tmpm380/m382 - 28 / 49 - [1] port [3/5] address register name address register name address register name address register name 0x4000_0180 reserved 0x4000_0190 reserved 0x4000_01a0 0x4000_01b0 reserved 0x4000_0181 0x4000_0191 0x4000_01a1 0x4000_01b1 0x4000_0182 0x4000_0192 0x4000_01a2 0x4000_01b2 0x4000_0183 0x4000_0193 0x4000_01a3 0x4000_01b3 0x4000_0184 reserved 0x4000_0194 0x4000_01a4 0x4000_01b4 0x4000_0185 0x4000_0195 0x4000_01a5 0x4000_01b5 0x4000_0186 0x4000_0196 0x4000_01a6 0x4000_01b6 0x4000_0187 0x4000_0197 0x4000_01a7 0x4000_01b7 0x4000_0188 reserved 0x4000_0198 0x4000_01a8 reserved 0x4000_01b8 reserved 0x4000_0189 0x4000_0199 0x4000_01a9 0x4000_01b9 0x4000_018a 0x4000_019a 0x4000_01aa 0x4000_01ba 0x4000_018b 0x4000_019b 0x4000_01ab 0x4000_01bb 0x4000_018c reserved 0x4000_019c 0x4000_01ac reserved 0x4000_01bc 0x4000_018d 0x4000_019d 0x4000_01ad 0x4000_01bd 0x4000_018e 0x4000_019e 0x4000_01ae 0x4000_01be 0x4000_018f 0x4000_019f 0x4000_01af 0x4000_01bf address register name address register name address register name address register name 0x4000_01c0 phdata 0x4000_01d0 0x4000_01e0 0x4000_01f0 phpdn 0x4000_01c1 0x4000_01d1 0x4000_01e1 0x4000_01f1 0x4000_01c2 0x4000_01d2 0x4000_01e2 0x4000_01f2 0x4000_01c3 0x4000_01d3 0x4000_01e3 0x4000_01f3 0x4000_01c4 phcr 0x4000_01d4 0x4000_01e4 0x4000_01f4 0x4000_01c5 0x4000_01d5 0x4000_01e5 0x4000_01f5 0x4000_01c6 0x4000_01d6 0x4000_01e6 0x4000_01f6 0x4000_01c7 0x4000_01d7 0x4000_01e7 0x4000_01f7 0x4000_01c8 phfr1 0x4000_01d8 0x4000_01e8 phod 0x4000_01f8 phie 0x4000_01c9 0x4000_01d9 0x4000_01e9 0x4000_01f9 0x4000_01ca 0x4000_01da 0x4000_01ea 0x4000_01fa 0x4000_01cb 0x4000_01db 0x4000_01eb 0x4000_01fb 0x4000_01cc 0x4000_01dc 0x4000_01ec phpup 0x4000_01fc 0x4000_01cd 0x4000_01dd 0x4000_01ed 0x4000_01fd 0x4000_01ce 0x4000_01de 0x4000_01ee 0x4000_01fe 0x4000_01cf 0x4000_01df 0x4000_01ef 0x4000_01ff address register name address register name address register name address register name 0x4000_0200 pidata 0x4000_0210 0x4000_0220 0x4000_0230 pipdn 0x4000_0201 0x4000_0211 0x4000_0221 0x4000_0231 0x4000_0202 0x4000_0212 0x4000_0222 0x4000_0232 0x4000_0203 0x4000_0213 0x4000_0223 0x4000_0233 0x4000_0204 picr 0x4000_0214 0x4000_0224 0x4000_0234 0x4000_0205 0x4000_0215 0x4000_0225 0x4000_0235 0x4000_0206 0x4000_0216 0x4000_0226 0x4000_0236 0x4000_0207 0x4000_0217 0x4000_0227 0x4000_0237 0x4000_0208 0x4000_0218 0x4000_0228 piod 0x4000_0238 piie 0x4000_0209 0x4000_0219 0x4000_0229 0x4000_0239 0x4000_020a 0x4000_021a 0x4000_022a 0x4000_023a 0x4000_020b 0x4000_021b 0x4000_022b 0x4000_023b 0x4000_020c 0x4000_021c 0x4000_022c pipup 0x4000_023c 0x4000_020d 0x4000_021d 0x4000_022d 0x4000_023d 0x4000_020e 0x4000_021e 0x4000_022e 0x4000_023e 0x4000_020f 0x4000_021f 0x4000_022f 0x4000_023f
tmpm380/m382 tmpm380/m382 - 29 / 49 - ? [1] port [4/5] address register name address register name address register name address register name 0x4000_0240 reserved 0x4000_0250 0x4000_0260 0x4000_0270 reserved 0x4000_0241 0x4000_0251 0x4000_0261 0x4000_0271 0x4000_0242 0x4000_0252 0x4000_0262 0x4000_0272 0x4000_0243 0x4000_0253 0x4000_0263 0x4000_0273 0x4000_0244 reserved 0x4000_0254 0x4000_0264 0x4000_0274 0x4000_0245 0x4000_0255 0x4000_0265 0x4000_0275 0x4000_0246 0x4000_0256 0x4000_0266 0x4000_0276 0x4000_0247 0x4000_0257 0x4000_0267 0x4000_0277 0x4000_0248 reserved 0x4000_0258 0x4000_0268 reserved 0x4000_0278 reserved 0x4000_0249 0x4000_0259 0x4000_0269 0x4000_0279 0x4000_024a 0x4000_025a 0x4000_026a 0x4000_027a 0x4000_024b 0x4000_025b 0x4000_026b 0x4000_027b 0x4000_024c 0x4000_025c 0x4000_026c reserved 0x4000_027c 0x4000_024d 0x4000_025d 0x4000_026d 0x4000_027d 0x4000_024e 0x4000_025e 0x4000_026e 0x4000_027e 0x4000_024f 0x4000_025f 0x4000_026f 0x4000_027f address register name address register name address register name address register name 0x4000_0280 0x4000_0290 0x4000_02a0 0x4000_02b0 0x4000_0281 0x4000_0291 0x4000_02a1 0x4000_02b1 0x4000_0282 0x4000_0292 0x4000_02a2 0x4000_02b2 0x4000_0283 0x4000_0293 0x4000_02a3 0x4000_02b3 0x4000_0284 0x4000_0294 0x4000_02a4 0x4000_02b4 0x4000_0285 0x4000_0295 0x4000_02a5 0x4000_02b5 0x4000_0286 0x4000_0296 0x4000_02a6 0x4000_02b6 0x4000_0287 0x4000_0297 0x4000_02a7 0x4000_02b7 0x4000_0288 0x4000_0298 0x4000_02a8 0x4000_02b8 0x4000_0289 0x4000_0299 0x4000_02a9 0x4000_02b9 0x4000_028a 0x4000_029a 0x4000_02aa 0x4000_02ba 0x4000_028b 0x4000_029b 0x4000_02ab 0x4000_02bb 0x4000_028c 0x4000_029c 0x4000_02ac 0x4000_02bc 0x4000_028d 0x4000_029d 0x4000_02ad 0x4000_02bd 0x4000_028e 0x4000_029e 0x4000_02ae 0x4000_02be 0x4000_028f 0x4000_029f 0x4000_02af 0x4000_02bf address register name address register name address register name address register name 0x4000_02c0 pldata 0x4000_02d0 0x4000_02e0 0x4000_02f0 plpdn 0x4000_02c1 0x4000_02d1 0x4000_02e1 0x4000_02f1 0x4000_02c2 0x4000_02d2 0x4000_02e2 0x4000_02f2 0x4000_02c3 0x4000_02d3 0x4000_02e3 0x4000_02f3 0x4000_02c4 plcr 0x4000_02d4 0x4000_02e4 0x4000_02f4 0x4000_02c5 0x4000_02d5 0x4000_02e5 0x4000_02f5 0x4000_02c6 0x4000_02d6 0x4000_02e6 0x4000_02f6 0x4000_02c7 0x4000_02d7 0x4000_02e7 0x4000_02f7 0x4000_02c8 plfr1 0x4000_02d8 0x4000_02e8 plod 0x4000_02f8 plie 0x4000_02c9 0x4000_02d9 0x4000_02e9 0x4000_02f9 0x4000_02ca 0x4000_02da 0x4000_02ea 0x4000_02fa 0x4000_02cb 0x4000_02db 0x4000_02eb 0x4000_02fb 0x4000_02cc 0x4000_02dc 0x4000_02ec plpup 0x4000_02fc 0x4000_02cd 0x4000_02dd 0x4000_02ed 0x4000_02fd 0x4000_02ce 0x4000_02de 0x4000_02ee 0x4000_02fe 0x4000_02cf 0x4000_02df 0x4000_02ef 0x4000_02ff
25 special function registers tmpm380/m382 tmpm380/m382 - 30 / 49 - [1] port [5/5] address register name address register name address register name address register name 0x4000_0300 pmdata 0x4000_0310 0x4000_0320 0x4000_0330 pmpdn 0x4000_0301 0x4000_0311 0x4000_0321 0x4000_0331 0x4000_0302 0x4000_0312 0x4000_0322 0x4000_0332 0x4000_0303 0x4000_0313 0x4000_0323 0x4000_0333 0x4000_0304 pmcr 0x4000_0314 0x4000_0324 0x4000_0334 0x4000_0305 0x4000_0315 0x4000_0325 0x4000_0335 0x4000_0306 0x4000_0316 0x4000_0326 0x4000_0336 0x4000_0307 0x4000_0317 0x4000_0327 0x4000_0337 0x4000_0308 0x4000_0318 0x4000_0328 pmod 0x4000_0338 pmie 0x4000_0309 0x4000_0319 0x4000_0329 0x4000_0339 0x4000_030a 0x4000_031a 0x4000_032a 0x4000_033a 0x4000_030b 0x4000_031b 0x4000_032b 0x4000_033b 0x4000_030c 0x4000_031c 0x4000_032c pmpup 0x4000_033c 0x4000_030d 0x4000_031d 0x4000_032d 0x4000_033d 0x4000_030e 0x4000_031e 0x4000_032e 0x4000_033e 0x4000_030f 0x4000_031f 0x4000_032f 0x4000_033f address register name address register name address register name address register name 0x4000_0340 0x4000_0350 0x4000_0360 0x4000_0370 0x4000_0341 0x4000_0351 0x4000_0361 0x4000_0371 0x4000_0342 0x4000_0352 0x4000_0362 0x4000_0372 0x4000_0343 0x4000_0353 0x4000_0363 0x4000_0373 0x4000_0344 0x4000_0354 0x4000_0364 0x4000_0374 0x4000_0345 0x4000_0355 0x4000_0365 0x4000_0375 0x4000_0346 0x4000_0356 0x4000_0366 0x4000_0376 0x4000_0347 0x4000_0357 0x4000_0367 0x4000_0377 0x4000_0348 0x4000_0358 0x4000_0368 0x4000_0378 0x4000_0349 0x4000_0359 0x4000_0369 0x4000_0379 0x4000_034a 0x4000_035a 0x4000_036a 0x4000_037a 0x4000_034b 0x4000_035b 0x4000_036b 0x4000_037b 0x4000_034c 0x4000_035c 0x4000_036c 0x4000_037c 0x4000_034d 0x4000_035d 0x4000_036d 0x4000_037d 0x4000_034e 0x4000_035e 0x4000_036e 0x4000_037e 0x4000_034f 0x4000_035f 0x4000_036f 0x4000_037f address register name address register name address r egister name address register name 0x4000_0380 ppdata 0x4000_0390 0x4000_03a0 0x4000_03b0 pppdn 0x4000_0381 0x4000_0391 0x4000_03a1 0x4000_03b1 0x4000_0382 0x4000_0392 0x4000_03a2 0x4000_03b2 0x4000_0383 0x4000_0393 0x4000_03a3 0x4000_03b3 0x4000_0384 ppcr 0x4000_0394 0x4000_03a4 0x4000_03b4 0x4000_0385 0x4000_0395 0x4000_03a5 0x4000_03b5 0x4000_0386 0x4000_0396 0x4000_03a6 0x4000_03b6 0x4000_0387 0x4000_0397 0x4000_03a7 0x4000_03b7 0x4000_0388 0x4000_0398 0x4000_03a8 ppod 0x4000_03b8 ppie 0x4000_0389 0x4000_0399 0x4000_03a9 0x4000_03b9 0x4000_038a 0x4000_039a 0x4000_03aa 0x4000_03ba 0x4000_038b 0x4000_039b 0x4000_03ab 0x4000_03bb 0x4000_038c 0x4000_039c 0x4000_03ac pppup 0x4000_03bc 0x4000_038d 0x4000_039d 0x4000_03ad 0x4000_03bd 0x4000_038e 0x4000_039e 0x4000_03ae 0x4000_03be 0x4000_038f 0x4000_039f 0x4000_03af 0x4000_03bf
tmpm380/m382 tmpm380/m382 - 31 / 49 - ? ? 25.2.2 [2] 16-bit timer [1/3] address register name address register name address register name address register name 0x4001_0000 tb0en 0x4001_0010 tb0ffcr 0x4001_0020 tb0rg0 0x4001_0030 0x4001_0001 0x4001_0011 0x4001_0021 0x4001_0031 0x4001_0002 0x4001_0012 0x4001_0022 0x4001_0032 0x4001_0003 0x4001_0013 0x4001_0023 0x4001_0033 0x4001_0004 tb0run 0x4001_0014 tb0st 0x4001_0024 tb0rg1 0x4001_0034 0x4001_0005 0x4001_0015 0x4001_0025 0x4001_0035 0x4001_0006 0x4001_0016 0x4001_0026 0x4001_0036 0x4001_0007 0x4001_0017 0x4001_0027 0x4001_0037 0x4001_0008 tb0cr 0x4001_0018 tb0im 0x4001_0028 tb0cp0 0x4001_0038 0x4001_0009 0x4001_0019 0x4001_0029 0x4001_0039 0x4001_000a 0x4001_001a 0x4001_002a 0x4001_003a 0x4001_000b 0x4001_001b 0x4001_002b 0x4001_003b 0x4001_000c tb0mod 0x4001_001c tb0uc 0x4001_002c tb0cp1 0x4001_003c 0x4001_000d 0x4001_001d 0x4001_002d 0x4001_003d 0x4001_000e 0x4001_001e 0x4001_002e 0x4001_003e 0x4001_000f 0x4001_001f 0x4001_002f 0x4001_003f address register name address register name address register name address register name 0x4001_0040 tb1en 0x4001_0050 tb1ffcr 0x4001_0060 tb1rg0 0x4001_0070 0x4001_0041 0x4001_0051 0x4001_0061 0x4001_0071 0x4001_0042 0x4001_0052 0x4001_0062 0x4001_0072 0x4001_0043 0x4001_0053 0x4001_0063 0x4001_0073 0x4001_0044 tb1run 0x4001_0054 tb1st 0x4001_0064 tb1rg1 0x4001_0074 0x4001_0045 0x4001_0055 0x4001_0065 0x4001_0075 0x4001_0046 0x4001_0056 0x4001_0066 0x4001_0076 0x4001_0047 0x4001_0057 0x4001_0067 0x4001_0077 0x4001_0048 tb1cr 0x4001_0058 tb1im 0x4001_0068 tb1cp0 0x4001_0078 0x4001_0049 0x4001_0059 0x4001_0069 0x4001_0079 0x4001_004a 0x4001_005a 0x4001_006a 0x4001_007a 0x4001_004b 0x4001_005b 0x4001_006b 0x4001_007b 0x4001_004c tb1mod 0x4001_005c tb1uc 0x4001_006c tb1cp1 0x4001_007c 0x4001_004d 0x4001_005d 0x4001_006d 0x4001_007d 0x4001_004e 0x4001_005e 0x4001_006e 0x4001_007e 0x4001_004f 0x4001_005f 0x4001_006f 0x4001_007f address register name address register name address register name address register name 0x4001_0080 tb2en 0x4001_0090 tb2ffcr 0x4001_00a0 tb2rg0 0x4001_00b0 0x4001_0081 0x4001_0091 0x4001_00a1 0x4001_00b1 0x4001_0082 0x4001_0092 0x4001_00a2 0x4001_00b2 0x4001_0083 0x4001_0093 0x4001_00a3 0x4001_00b3 0x4001_0084 tb2run 0x4001_0094 tb2st 0x4001_00a4 tb2rg1 0x4001_00b4 0x4001_0085 0x4001_0095 0x4001_00a5 0x4001_00b5 0x4001_0086 0x4001_0096 0x4001_00a6 0x4001_00b6 0x4001_0087 0x4001_0097 0x4001_00a7 0x4001_00b7 0x4001_0088 tb2cr 0x4001_0098 tb2im 0x4001_00a8 tb2cp0 0x4001_00b8 0x4001_0089 0x4001_0099 0x4001_00a9 0x4001_00b9 0x4001_008a 0x4001_009a 0x4001_00aa 0x4001_00ba 0x4001_008b 0x4001_009b 0x4001_00ab 0x4001_00bb 0x4001_008c tb2mod 0x4001_009c tb2uc 0x4001_00ac tb2cp1 0x4001_00bc 0x4001_008d 0x4001_009d 0x4001_00ad 0x4001_00bd 0x4001_008e 0x4001_009e 0x4001_00ae 0x4001_00be 0x4001_008f 0x4001_009f 0x4001_00af 0x4001_00bf
25 special function registers tmpm380/m382 tmpm380/m382 - 32 / 49 - [2] 16-bit timer [2/3] address register name address register name address register name address register name 0x4001_00c0 tb3en 0x4001_00d0 reserved 0x4001_00e0 tb3rg0 0x4001_00f0 0x4001_00c1 0x4001_00d1 0x4001_00e1 0x4001_00f1 0x4001_00c2 0x4001_00d2 0x4001_00e2 0x4001_00f2 0x4001_00c3 0x4001_00d3 0x4001_00e3 0x4001_00f3 0x4001_00c4 tb3run 0x4001_00d4 tb3st 0x4001_00e4 tb3rg1 0x4001_00f4 0x4001_00c5 0x4001_00d5 0x4001_00e5 0x4001_00f5 0x4001_00c6 0x4001_00d6 0x4001_00e6 0x4001_00f6 0x4001_00c7 0x4001_00d7 0x4001_00e7 0x4001_00f7 0x4001_00c8 tb3cr 0x4001_00d8 tb3im 0x4001_00e8 tb3cp0 0x4001_00f8 0x4001_00c9 0x4001_00d9 0x4001_00e9 0x4001_00f9 0x4001_00ca 0x4001_00da 0x4001_00ea 0x4001_00fa 0x4001_00cb 0x4001_00db 0x4001_00eb 0x4001_00fb 0x4001_00cc tb3mod 0x4001_00dc tb3uc 0x4001_00ec tb3cp1 0x4001_00fc 0x4001_00cd 0x4001_00dd 0x4001_00ed 0x4001_00fd 0x4001_00ce 0x4001_00de 0x4001_00ee 0x4001_00fe 0x4001_00cf 0x4001_00df 0x4001_00ef 0x4001_00ff address register name address register name address register name address register name 0x4001_0100 tb4en 0x4001_0110 tb4ffcr 0x4001_0120 tb4rg0 0x4001_0130 0x4001_0101 0x4001_0111 0x4001_0121 0x4001_0131 0x4001_0102 0x4001_0112 0x4001_0122 0x4001_0132 0x4001_0103 0x4001_0113 0x4001_0123 0x4001_0133 0x4001_0104 tb4run 0x4001_0114 tb4st 0x4001_0124 tb4rg1 0x4001_0134 0x4001_0105 0x4001_0115 0x4001_0125 0x4001_0135 0x4001_0106 0x4001_0116 0x4001_0126 0x4001_0136 0x4001_0107 0x4001_0117 0x4001_0127 0x4001_0137 0x4001_0108 tb4cr 0x4001_0118 tb4im 0x4001_0128 tb4cp0 0x4001_0138 0x4001_0109 0x4001_0119 0x4001_0129 0x4001_0139 0x4001_010a 0x4001_011a 0x4001_012a 0x4001_013a 0x4001_010b 0x4001_011b 0x4001_012b 0x4001_013b 0x4001_010c tb4mod 0x4001_011c tb4uc 0x4001_012c tb4cp1 0x4001_013c 0x4001_010d 0x4001_011d 0x4001_012d 0x4001_013d 0x4001_010e 0x4001_011e 0x4001_012e 0x4001_013e 0x4001_010f 0x4001_011f 0x4001_012f 0x4001_013f address register name address register name address register name address register name 0x4001_0140 tb5en 0x4001_0150 tb5ffcr 0x4001_0160 tb5rg0 0x4001_0170 0x4001_0141 0x4001_0151 0x4001_0161 0x4001_0171 0x4001_0142 0x4001_0152 0x4001_0162 0x4001_0172 0x4001_0143 0x4001_0153 0x4001_0163 0x4001_0173 0x4001_0144 tb5run 0x4001_0154 tb5st 0x4001_0164 tb5rg1 0x4001_0174 0x4001_0145 0x4001_0155 0x4001_0165 0x4001_0175 0x4001_0146 0x4001_0156 0x4001_0166 0x4001_0176 0x4001_0147 0x4001_0157 0x4001_0167 0x4001_0177 0x4001_0148 tb5cr 0x4001_0158 tb5im 0x4001_0168 tb5cp0 0x4001_0178 0x4001_0149 0x4001_0159 0x4001_0169 0x4001_0179 0x4001_014a 0x4001_015a 0x4001_016a 0x4001_017a 0x4001_014b 0x4001_015b 0x4001_016b 0x4001_017b 0x4001_014c tb5mod 0x4001_015c tb5uc 0x4001_016c tb5cp1 0x4001_017c 0x4001_014d 0x4001_015d 0x4001_016d 0x4001_017d 0x4001_014e 0x4001_015e 0x4001_016e 0x4001_017e 0x4001_014f 0x4001_015f 0x4001_016f 0x4001_017f
tmpm380/m382 tmpm380/m382 - 33 / 49 - ? [2] 16-bit timer [3/3] address register name address register name address register name address register name 0x4001_0180 tb6en 0x4001_0190 tb6ffcr 0x4001_01a0 tb6rg0 0x4001_01b0 0x4001_0181 0x4001_0191 0x4001_01a1 0x4001_01b1 0x4001_0182 0x4001_0192 0x4001_01a2 0x4001_01b2 0x4001_0183 0x4001_0193 0x4001_01a3 0x4001_01b3 0x4001_0184 tb6run 0x4001_0194 tb6st 0x4001_01a4 tb6rg1 0x4001_01b4 0x4001_0185 0x4001_0195 0x4001_01a5 0x4001_01b5 0x4001_0186 0x4001_0196 0x4001_01a6 0x4001_01b6 0x4001_0187 0x4001_0197 0x4001_01a7 0x4001_01b7 0x4001_0188 tb6cr 0x4001_0198 tb6im 0x4001_01a8 tb6cp0 0x4001_01b8 0x4001_0189 0x4001_0199 0x4001_01a9 0x4001_01b9 0x4001_018a 0x4001_019a 0x4001_01aa 0x4001_01ba 0x4001_018b 0x4001_019b 0x4001_01ab 0x4001_01bb 0x4001_018c tb6mod 0x4001_019c tb6uc 0x4001_01ac tb6cp1 0x4001_01bc 0x4001_018d 0x4001_019d 0x4001_01ad 0x4001_01bd 0x4001_018e 0x4001_019e 0x4001_01ae 0x4001_01be 0x4001_018f 0x4001_019f 0x4001_01af 0x4001_01bf address register name address register name address register name address r egister name 0x4001_01c0 tb7en 0x4001_01d0 tb7ffcr 0x4001_01e0 tb7rg0 0x4001_01f0 0x4001_01c1 0x4001_01d1 0x4001_01e1 0x4001_01f1 0x4001_01c2 0x4001_01d2 0x4001_01e2 0x4001_01f2 0x4001_01c3 0x4001_01d3 0x4001_01e3 0x4001_01f3 0x4001_01c4 tb7run 0x4001_01d4 tb7st 0x4001_01e4 tb7rg1 0x4001_01f4 0x4001_01c5 0x4001_01d5 0x4001_01e5 0x4001_01f5 0x4001_01c6 0x4001_01d6 0x4001_01e6 0x4001_01f6 0x4001_01c7 0x4001_01d7 0x4001_01e7 0x4001_01f7 0x4001_01c8 tb7cr 0x4001_01d8 tb7im 0x4001_01e8 tb7cp0 0x4001_01f8 0x4001_01c9 0x4001_01d9 0x4001_01e9 0x4001_01f9 0x4001_01ca 0x4001_01da 0x4001_01ea 0x4001_01fa 0x4001_01cb 0x4001_01db 0x4001_01eb 0x4001_01fb 0x4001_01cc tb7mod 0x4001_01dc tb7uc 0x4001_01ec tb7cp1 0x4001_01fc 0x4001_01cd 0x4001_01dd 0x4001_01ed 0x4001_01fd 0x4001_01ce 0x4001_01de 0x4001_01ee 0x4001_01fe 0x4001_01cf 0x4001_01df 0x4001_01ef 0x4001_01ff
25 special function registers tmpm380/m382 tmpm380/m382 - 34 / 49 - 25.2.3 [3] encoder input (enc) address register name address register name address register name address register name 0x4001_0400 reserved 0x4001_0410 reserved 0x4001_0420 reserved 0x4001_0430 reserved 0x4001_0401 0x4001_0411 0x4001_0421 0x4001_0431 0x4001_0402 0x4001_0412 0x4001_0422 0x4001_0432 0x4001_0403 0x4001_0413 0x4001_0423 0x4001_0433 0x4001_0404 reserved 0x4001_0414 reserved 0x4001_0424 reserved 0x4001_0434 reserved 0x4001_0405 0x4001_0415 0x4001_0425 0x4001_0435 0x4001_0406 0x4001_0416 0x4001_0426 0x4001_0436 0x4001_0407 0x4001_0417 0x4001_0427 0x4001_0437 0x4001_0408 reserved 0x4001_0418 reserved 0x4001_0428 reserved 0x4001_0438 reserved 0x4001_0409 0x4001_0419 0x4001_0429 0x4001_0439 0x4001_040a 0x4001_041a 0x4001_042a 0x4001_043a 0x4001_040b 0x4001_041b 0x4001_042b 0x4001_043b 0x4001_040c reserved 0x4001_041c reserved 0x4001_042c reserved 0x4001_043c reserved 0x4001_040d 0x4001_041d 0x4001_042d 0x4001_043d 0x4001_040e 0x4001_041e 0x4001_042e 0x4001_043e 0x4001_040f 0x4001_041f 0x4001_042f 0x4001_043f address register name address register name address register name address register name 0x4001_0500 reserved 0x4001_0510 reserved 0x4001_0520 reserved 0x4001_0530 reserved 0x4001_0501 0x4001_0511 0x4001_0521 0x4001_0531 0x4001_0502 0x4001_0512 0x4001_0522 0x4001_0532 0x4001_0503 0x4001_0513 0x4001_0523 0x4001_0533 0x4001_0504 reserved 0x4001_0514 reserved 0x4001_0524 reserved 0x4001_0534 reserved 0x4001_0505 0x4001_0515 0x4001_0525 0x4001_0535 0x4001_0506 0x4001_0516 0x4001_0526 0x4001_0536 0x4001_0507 0x4001_0517 0x4001_0527 0x4001_0537 0x4001_0508 reserved 0x4001_0518 reserved 0x4001_0528 reserved 0x4001_0538 reserved 0x4001_0509 0x4001_0519 0x4001_0529 0x4001_0539 0x4001_050a 0x4001_051a 0x4001_052a 0x4001_053a 0x4001_050b 0x4001_051b 0x4001_052b 0x4001_053b 0x4001_050c reserved 0x4001_051c reserved 0x4001_052c reserved 0x4001_053c reserved 0x4001_050d 0x4001_051d 0x4001_052d 0x4001_053d 0x4001_050e 0x4001_051e 0x4001_052e 0x4001_053e 0x4001_050f 0x4001_051f 0x4001_052f 0x4001_053f
tmpm380/m382 tmpm380/m382 - 35 / 49 - ? 25.2.4 [4] serial bus interface (sbi) address register name address register name address register name address register name 0x4002_0000 sbi0cr0 0x4002_0010 sbi0cr2/sr 0x4002_0020 reserved 0x4002_0030 reserved 0x4002_0001 0x4002_0011 0x4002_0021 0x4002_0031 0x4002_0002 0x4002_0012 0x4002_0022 0x4002_0032 0x4002_0003 0x4002_0013 0x4002_0023 0x4002_0033 0x4002_0004 sbi0cr1 0x4002_0014 sbi0br0 0x4002_0024 reserved 0x4002_0034 reserved 0x4002_0005 0x4002_0015 0x4002_0025 0x4002_0035 0x4002_0006 0x4002_0016 0x4002_0026 0x4002_0036 0x4002_0007 0x4002_0017 0x4002_0027 0x4002_0037 0x4002_0008 sbi0dbr 0x4002_0018 0x4002_0028 reserved 0x4002_0038 0x4002_0009 0x4002_0019 0x4002_0029 0x4002_0039 0x4002_000a 0x4002_001a 0x4002_002a 0x4002_003a 0x4002_000b 0x4002_001b 0x4002_002b 0x4002_003b 0x4002_000c sbi0i2car 0x4002_001c 0x4002_002c reserved 0x4002_003c 0x4002_000d 0x4002_001d 0x4002_002d 0x4002_003d 0x4002_000e 0x4002_001e 0x4002_002e 0x4002_003e 0x4002_000f 0x4002_001f 0x4002_002f 0x4002_003f address register name address register name address register name address register name 0x4002_0040 0x4002_0050 0x4002_0060 0x4002_0070 0x4002_0041 0x4002_0051 0x4002_0061 0x4002_0071 0x4002_0042 0x4002_0052 0x4002_0062 0x4002_0072 0x4002_0043 0x4002_0053 0x4002_0063 0x4002_0073 0x4002_0044 0x4002_0054 0x4002_0064 0x4002_0074 0x4002_0045 0x4002_0055 0x4002_0065 0x4002_0075 0x4002_0046 0x4002_0056 0x4002_0066 0x4002_0076 0x4002_0047 0x4002_0057 0x4002_0067 0x4002_0077 0x4002_0048 0x4002_0058 0x4002_0068 0x4002_0078 0x4002_0049 0x4002_0059 0x4002_0069 0x4002_0079 0x4002_004a 0x4002_005a 0x4002_006a 0x4002_007a 0x4002_004b 0x4002_005b 0x4002_006b 0x4002_007b 0x4002_004c 0x4002_005c 0x4002_006c 0x4002_007c 0x4002_004d 0x4002_005d 0x4002_006d 0x4002_007d 0x4002_004e 0x4002_005e 0x4002_006e 0x4002_007e 0x4002_004f 0x4002_005f 0x4002_006f 0x4002_007f
25 special function registers tmpm380/m382 tmpm380/m382 - 36 / 49 - 25.2.5 [5] serial interface (uart/sio) address register name address register name address register name address register name 0x4002_0080 sc0en 0x4002_0090 sc0brcr 0x4002_00a0 sc0rfc 0x4002_00b0 sc0fcnf 0x4002_0081 0x4002_0091 0x4002_00a1 0x4002_00b1 0x4002_0082 0x4002_0092 0x4002_00a2 0x4002_00b2 0x4002_0083 0x4002_0093 0x4002_00a3 0x4002_00b3 0x4002_0084 sc0buf 0x4002_0094 sc0bradd 0x4002_00a4 sc0tfc 0x4002_00b4 0x4002_0085 0x4002_0095 0x4002_00a5 0x4002_00b5 0x4002_0086 0x4002_0096 0x4002_00a6 0x4002_00b6 0x4002_0087 0x4002_0097 0x4002_00a7 0x4002_00b7 0x4002_0088 sc0cr 0x4002_0098 sc0mod1 0x4002_00a8 sc0rst 0x4002_00b8 0x4002_0089 0x4002_0099 0x4002_00a9 0x4002_00b9 0x4002_008a 0x4002_009a 0x4002_00aa 0x4002_00ba 0x4002_008b 0x4002_009b 0x4002_00ab 0x4002_00bb 0x4002_008c sc0mod0 0x4002_009c sc0mod2 0x4002_00ac sc0tst 0x4002_00bc 0x4002_008d 0x4002_009d 0x4002_00ad 0x4002_00bd 0x4002_008e 0x4002_009e 0x4002_00ae 0x4002_00be 0x4002_008f 0x4002_009f 0x4002_00af 0x4002_00bf address register name address register name address register name address register name 0x4002_00c0 sc1en 0x4002_00d0 sc1brcr 0x4002_00e0 sc1rfc 0x4002_00f0 sc1fcnf 0x4002_00c1 0x4002_00d1 0x4002_00e1 0x4002_00f1 0x4002_00c2 0x4002_00d2 0x4002_00e2 0x4002_00f2 0x4002_00c3 0x4002_00d3 0x4002_00e3 0x4002_00f3 0x4002_00c4 sc1buf 0x4002_00d4 sc1bradd 0x4002_00e4 sc1tfc 0x4002_00f4 0x4002_00c5 0x4002_00d5 0x4002_00e5 0x4002_00f5 0x4002_00c6 0x4002_00d6 0x4002_00e6 0x4002_00f6 0x4002_00c7 0x4002_00d7 0x4002_00e7 0x4002_00f7 0x4002_00c8 sc1cr 0x4002_00d8 sc1mod1 0x4002_00e8 sc1rst 0x4002_00f8 0x4002_00c9 0x4002_00d9 0x4002_00e9 0x4002_00f9 0x4002_00ca 0x4002_00da 0x4002_00ea 0x4002_00fa 0x4002_00cb 0x4002_00db 0x4002_00eb 0x4002_00fb 0x4002_00cc sc1mod0 0x4002_00dc sc1mod2 0x4002_00ec sc1tst 0x4002_00fc 0x4002_00cd 0x4002_00dd 0x4002_00ed 0x4002_00fd 0x4002_00ce 0x4002_00de 0x4002_00ee 0x4002_00fe 0x4002_00cf 0x4002_00df 0x4002_00ef 0x4002_00ff address register name address register name address register name address register name 0x4002_0100 reserved 0x4002_0110 reserved 0x4002_0120 reserved 0x4002_0130 reserved 0x4002_0101 0x4002_0111 0x4002_0121 0x4002_0131 0x4002_0102 0x4002_0112 0x4002_0122 0x4002_0132 0x4002_0103 0x4002_0113 0x4002_0123 0x4002_0133 0x4002_0104 reserved 0x4002_0114 reserved 0x4002_0124 reserved 0x4002_0134 0x4002_0105 0x4002_0115 0x4002_0125 0x4002_0135 0x4002_0106 0x4002_0116 0x4002_0126 0x4002_0136 0x4002_0107 0x4002_0117 0x4002_0127 0x4002_0137 0x4002_0108 reserved 0x4002_0118 reserved 0x4002_0128 reserved 0x4002_0138 0x4002_0109 0x4002_0119 0x4002_0129 0x4002_0139 0x4002_010a 0x4002_011a 0x4002_012a 0x4002_013a 0x4002_010b 0x4002_011b 0x4002_012b 0x4002_013b 0x4002_010c reserved 0x4002_011c reserved 0x4002_012c reserved 0x4002_013c 0x4002_010d 0x4002_011d 0x4002_012d 0x4002_013d 0x4002_010e 0x4002_011e 0x4002_012e 0x4002_013e 0x4002_010f 0x4002_011f 0x4002_012f 0x4002_013f
tmpm380/m382 tmpm380/m382 - 37 / 49 - ? [5] serial interface (uart/sio) [2/2] address register name address register name address register name address register name 0x4002_0140 reserved 0x4002_0150 reserved 0x4002_0160 reserved 0x4002_0170 reserved 0x4002_0141 0x4002_0151 0x4002_0161 0x4002_0171 0x4002_0142 0x4002_0152 0x4002_0162 0x4002_0172 0x4002_0143 0x4002_0153 0x4002_0163 0x4002_0173 0x4002_0144 reserved 0x4002_0154 reserved 0x4002_0164 reserved 0x4002_0174 0x4002_0145 0x4002_0155 0x4002_0165 0x4002_0175 0x4002_0146 0x4002_0156 0x4002_0166 0x4002_0176 0x4002_0147 0x4002_0157 0x4002_0167 0x4002_0177 0x4002_0148 reserved 0x4002_0158 reserved 0x4002_0168 reserved 0x4002_0178 0x4002_0149 0x4002_0159 0x4002_0169 0x4002_0179 0x4002_014a 0x4002_015a 0x4002_016a 0x4002_017a 0x4002_014b 0x4002_015b 0x4002_016b 0x4002_017b 0x4002_014c reserved 0x4002_015c reserved 0x4002_016c reserved 0x4002_017c 0x4002_014d 0x4002_015d 0x4002_016d 0x4002_017d 0x4002_014e 0x4002_015e 0x4002_016e 0x4002_017e 0x4002_014f 0x4002_015f 0x4002_016f 0x4002_017f address register name address register name address register name address register name 0x4002_0180 sc4en 0x4002_0190 sc4brcr 0x4002_01a0 sc4rfc 0x4002_01b0 sc4fcnf 0x4002_0181 0x4002_0191 0x4002_01a1 0x4002_01b1 0x4002_0182 0x4002_0192 0x4002_01a2 0x4002_01b2 0x4002_0183 0x4002_0193 0x4002_01a3 0x4002_01b3 0x4002_0184 sc4buf 0x4002_0194 sc4bradd 0x4002_01a4 sc4tfc 0x4002_01b4 0x4002_0185 0x4002_0195 0x4002_01a5 0x4002_01b5 0x4002_0186 0x4002_0196 0x4002_01a6 0x4002_01b6 0x4002_0187 0x4002_0197 0x4002_01a7 0x4002_01b7 0x4002_0188 sc4cr 0x4002_0198 sc4mod1 0x4002_01a8 sc4rst 0x4002_01b8 0x4002_0189 0x4002_0199 0x4002_01a9 0x4002_01b9 0x4002_018a 0x4002_019a 0x4002_01aa 0x4002_01ba 0x4002_018b 0x4002_019b 0x4002_01ab 0x4002_01bb 0x4002_018c sc4mod0 0x4002_019c sc4mod2 0x4002_01ac sc4tst 0x4002_01bc 0x4002_018d 0x4002_019d 0x4002_01ad 0x4002_01bd 0x4002_018e 0x4002_019e 0x4002_01ae 0x4002_01be 0x4002_018f 0x4002_019f 0x4002_01af 0x4002_01bf
25 special function registers tmpm380/m382 tmpm380/m382 - 38 / 49 - 25.2.6 [6] 12-bit a/d converter (a/dc) [1/2] address register name address register name address register name address register name 0x4003_0000 adclk 0x4003_0010 adcmpcr0 0x4003_0020 addresseg0 0x4003_0030 addresseg4 0x4003_0001 0x4003_0011 0x4003_0021 0x4003_0031 0x4003_0002 0x4003_0012 0x4003_0022 0x4003_0032 0x4003_0003 0x4003_0013 0x4003_0023 0x4003_0033 0x4003_0004 admod0 0x4003_0014 adcmpcr1 0x 4003_0024 addresseg1 0x4003_0034 addresseg5 0x4003_0005 0x4003_0015 0x4003_0025 0x4003_0035 0x4003_0006 0x4003_0016 0x4003_0026 0x4003_0036 0x4003_0007 0x4003_0017 0x4003_0027 0x4003_0037 0x4003_0008 admod1 0x4003_0018 adcmp0 0x 4003_0028 addresseg2 0x4003_0038 addresseg6 0x4003_0009 0x4003_0019 0x4003_0029 0x4003_0039 0x4003_000a 0x4003_001a 0x4003_002a 0x4003_003a 0x4003_000b 0x4003_001b 0x4003_002b 0x4003_003b 0x4003_000c admod2 0x4003_001c adcmp1 0x4003_002c addresseg3 0x4003_003c addresseg7 0x4003_000d 0x4003_001d 0x4003_002d 0x4003_003d 0x4003_000e 0x4003_001e 0x4003_002e 0x4003_003e 0x4003_000f 0x4003_001f 0x4003_002f 0x4003_003f address register name address register name address register name address register name 0x4003_0040 addresseg8 0x4003_0050 adpsel0 0x4003_0060 reserved 0x4003_0070 reserved 0x4003_0041 0x4003_0051 0x4003_0061 0x4003_0071 0x4003_0042 0x4003_0052 0x4003_0062 0x4003_0072 0x4003_0043 0x4003_0053 0x4003_0063 0x4003_0073 0x4003_0044 addresseg9 0x4003_0054 adpsel1 0x4003_0064 reserved 0x4003_0074 reserved 0x4003_0045 0x4003_0055 0x4003_0065 0x4003_0075 0x4003_0046 0x4003_0056 0x4003_0066 0x4003_0076 0x4003_0047 0x4003_0057 0x4003_0067 0x4003_0077 0x4003_0048 addresseg10 0x4003_0058 adpsel2 0x4003_0068 reserved 0x4003_0078 reserved 0x4003_0049 0x4003_0059 0x4003_0069 0x4003_0079 0x4003_004a 0x4003_005a 0x4003_006a 0x4003_007a 0x4003_004b 0x4003_005b 0x4003_006b 0x4003_007b 0x4003_004c addresseg11 0x4003_005c adpsel 3 0x4003_006c reserved 0x4003_007c reserved 0x4003_004d 0x4003_005d 0x4003_006d 0x4003_007d 0x4003_004e 0x4003_005e 0x4003_006e 0x4003_007e 0x4003_004f 0x4003_005f 0x4003_006f 0x4003_007f address register name address register name address register name address register name 0x4003_0080 adpints0 0x4003_0090 adpints4 0x4003_00a0 adpset2 0x4003_00b0 adtset03 0x4003_0081 0x4003_0091 0x4003_00a1 0x4003_00b1 0x4003_0082 0x4003_0092 0x4003_00a2 0x4003_00b2 0x4003_0083 0x4003_0093 0x4003_00a3 0x4003_00b3 0x4003_0084 adpints1 0x4003_0094 adpints5 0x4003_00a4 adpset3 0x4003_00b4 adtset47 0x4003_0085 0x4003_0095 0x4003_00a5 0x4003_00b5 0x4003_0086 0x4003_0096 0x4003_00a6 0x4003_00b6 0x4003_0087 0x4003_0097 0x4003_00a7 0x4003_00b7 0x4003_0088 adpints2 0x4003_0098 adpset0 0x 4003_00a8 adpset4 0x4003_00b8 adtset811 0x4003_0089 0x4003_0099 0x4003_00a9 0x4003_00b9 0x4003_008a 0x4003_009a 0x4003_00aa 0x4003_00ba 0x4003_008b 0x4003_009b 0x4003_00ab 0x4003_00bb 0x4003_008c adpints3 0x4003_009c adpset 1 0x4003_00ac adpset5 0x4003_00bc adsset03 0x4003_008d 0x4003_009d 0x4003_00ad 0x4003_00bd 0x4003_008e 0x4003_009e 0x4003_00ae 0x4003_00be 0x4003_008f 0x4003_009f 0x4003_00af 0x4003_00bf
tmpm380/m382 tmpm380/m382 - 39 / 49 - ? [6] 12-bit a/d converter (a/dc) [2/2] address register name address register name address register name address register name 0x4003_00c0 adsset47 0x4003_00d0 ad aset811 0x4003_00e0 0x4003_00f0 0x4003_00c1 0x4003_00d1 0x4003_00e1 0x4003_00f1 0x4003_00c2 0x4003_00d2 0x4003_00e2 0x4003_00f2 0x4003_00c3 0x4003_00d3 0x4003_00e3 0x4003_00f3 0x4003_00c4 adsset811 0x4003_00d4 ad mod3 0x4003_00e4 0x4003_00f4 0x4003_00c5 0x4003_00d5 0x4003_00e5 0x4003_00f5 0x4003_00c6 0x4003_00d6 0x4003_00e6 0x4003_00f6 0x4003_00c7 0x4003_00d7 0x4003_00e7 0x4003_00f7 0x4003_00c8 adaset03 0x4003_00d8 0x4003_00e8 0x4003_00f8 0x4003_00c9 0x4003_00d9 0x4003_00e9 0x4003_00f9 0x4003_00ca 0x4003_00da 0x4003_00ea 0x4003_00fa 0x4003_00cb 0x4003_00db 0x4003_00eb 0x4003_00fb 0x4003_00cc adaset47 0x4003_00dc 0x4003_00ec 0x4003_00fc 0x4003_00cd 0x4003_00dd 0x4003_00ed 0x4003_00fd 0x4003_00ce 0x4003_00de 0x4003_00ee 0x4003_00fe 0x4003_00cf 0x4003_00df 0x4003_00ef 0x4003_00ff
25 special function registers tmpm380/m382 tmpm380/m382 - 40 / 49 - 25.2.7 [7] watchdog timer (wdt) address register name address register name address register name address register name 0x4004_0000 wdmod 0x4004_0010 0x4004_0020 0x4004_0030 0x4004_0001 0x4004_0011 0x4004_0021 0x4004_0031 0x4004_0002 0x4004_0012 0x4004_0022 0x4004_0032 0x4004_0003 0x4004_0013 0x4004_0023 0x4004_0033 0x4004_0004 wdcr 0x4004_0014 0x4004_0024 0x4004_0034 0x4004_0005 0x4004_0015 0x4004_0025 0x4004_0035 0x4004_0006 0x4004_0016 0x4004_0026 0x4004_0036 0x4004_0007 0x4004_0017 0x4004_0027 0x4004_0037 0x4004_0008 0x4004_0018 0x4004_0028 0x4004_0038 0x4004_0009 0x4004_0019 0x4004_0029 0x4004_0039 0x4004_000a 0x4004_001a 0x4004_002a 0x4004_003a 0x4004_000b 0x4004_001b 0x4004_002b 0x4004_003b 0x4004_000c 0x4004_001c 0x4004_002c 0x4004_003c 0x4004_000d 0x4004_001d 0x4004_002d 0x4004_003d 0x4004_000e 0x4004_001e 0x4004_002e 0x4004_003e 0x4004_000f 0x4004_001f 0x4004_002f 0x4004_003f 25.2.8 [8] real time clock (rtc) address register name address register name address register name address register name 0x4004_0100 secr 0x4004_0110 0x4004_0120 0x4004_0130 0x4004_0101 minr 0x4004_0111 0x4004_0121 0x4004_0131 0x4004_0102 hourr 0x4004_0112 0x4004_0122 0x4004_0132 0x4004_0103 0x4004_0113 0x4004_0123 0x4004_0133 0x4004_0104 dayr 0x4004_0114 0x4004_0124 0x4004_0134 0x4004_0105 dater 0x4004_0115 0x4004_0125 0x4004_0135 0x4004_0106 monthr 0x4004_0116 0x4004_0126 0x4004_0136 0x4004_0107 yearr 0x4004_0117 0x4004_0127 0x4004_0137 0x4004_0108 pager 0x4004_0118 0x4004_0128 0x4004_0138 0x4004_0109 0x4004_0119 0x4004_0129 0x4004_0139 0x4004_010a 0x4004_011a 0x4004_012a 0x4004_013a 0x4004_010b 0x4004_011b 0x4004_012b 0x4004_013b 0x4004_010c restr 0x4004_011c 0x4004_012c 0x4004_013c 0x4004_010d 0x4004_011d 0x4004_012d 0x4004_013d 0x4004_010e 0x4004_011e 0x4004_012e 0x4004_013e 0x4004_010f 0x4004_011f 0x4004_012f 0x4004_013f 25.2.9 [9] clock generator (cg) address register name address register name address register name address register name 0x4004_0200 cgsyscr 0x4004_0210 cgcksel 0x4004_0220 cg imcga 0x4004_0230 cgimcge 0x4004_0201 0x4004_0211 0x4004_0221 0x4004_0231 0x4004_0202 0x4004_0212 0x4004_0222 0x4004_0232 0x4004_0203 0x4004_0213 0x4004_0223 0x4004_0233 0x4004_0204 cgosccr 0x4004_0214 cgicrcg 0x4004_0224 cgimcgb 0x4004_0234 0x4004_0205 0x4004_0215 0x4004_0225 0x4004_0235 0x4004_0206 0x4004_0216 0x4004_0226 0x4004_0236 0x4004_0207 0x4004_0217 0x4004_0227 0x4004_0237 0x4004_0208 cgstbycr 0x4004_0218 cgnmiflg 0x4004_0228 cgimcgc 0x4004_0238 0x4004_0209 0x4004_0219 0x4004_0229 0x4004_0239 0x4004_020a 0x4004_021a 0x4004_022a 0x4004_023a 0x4004_020b 0x4004_021b 0x4004_022b 0x4004_023b 0x4004_020c cgpllsel 0x4004_021c cgrstflg 0x4004_022c cgimcgd 0x4004_023c 0x4004_020d 0x4004_021d 0x4004_022d 0x4004_023d 0x4004_020e 0x4004_021e 0x4004_022e 0x4004_023e 0x4004_020f 0x4004_021f 0x4004_022f 0x4004_023f
tmpm380/m382 tmpm380/m382 - 41 / 49 - ? 25.2.10 [10] remote control signal preprocessor (rmc) address register name address register name address register name address register name 0x4004_0400 rmcen 0x4004_0410 rmcrbuf3 0x4004_0420 rmccr4 0x4004_0430 rmcend3 0x4004_0401 0x4004_0411 0x4004_0421 0x4004_0431 0x4004_0402 0x4004_0412 0x4004_0422 0x4004_0432 0x4004_0403 0x4004_0413 0x4004_0423 0x4004_0433 0x4004_0404 rmcren 0x4004_0414 rmcrcr1 0x4004_0424 rmcrstat 0x4004_0434 rmcfssel 0x4004_0405 0x4004_0415 0x4004_0425 0x4004_0435 0x4004_0406 0x4004_0416 0x4004_0426 0x4004_0436 0x4004_0407 0x4004_0417 0x4004_0427 0x4004_0437 0x4004_0408 rmcrbuf1 0x4004_0418 rmcrcr2 0x4004_0428 rmcend1 0x4004_0438 0x4004_0409 0x4004_0419 0x4004_0429 0x4004_0439 0x4004_040a 0x4004_041a 0x4004_042a 0x4004_043a 0x4004_040b 0x4004_041b 0x4004_042b 0x4004_043b 0x4004_040c rmcrbuf2 0x4004_041c rmcrcr3 0x4004_042c rmcend2 0x4004_043c 0x4004_040d 0x4004_041d 0x4004_042d 0x4004_043d 0x4004_040e 0x4004_041e 0x4004_042e 0x4004_043e 0x4004_040f 0x4004_041f 0x4004_042f 0x4004_043f 25.2.11 [11] oscillation frequency detector (ofd) address register name address register name address register name address register name 0x4004_0800 ofdcr1 0x4004_0810 ofdmx 0x4004_0820 0x4004_0830 0x4004_0801 0x4004_0811 0x4004_0821 0x4004_0831 0x4004_0802 0x4004_0812 0x4004_0822 0x4004_0832 0x4004_0803 0x4004_0813 0x4004_0823 0x4004_0833 0x4004_0804 ofdcr2 0x4004_0814 0x4004_0824 0x4004_0834 0x4004_0805 0x4004_0815 0x4004_0825 0x4004_0835 0x4004_0806 0x4004_0816 0x4004_0826 0x4004_0836 0x4004_0807 0x4004_0817 0x4004_0827 0x4004_0837 0x4004_0808 ofdmn 0x4004_0818 ofdrst 0x4004_0828 0x4004_0838 0x4004_0809 0x4004_0819 0x4004_0829 0x4004_0839 0x4004_080a 0x4004_081a 0x4004_082a 0x4004_083a 0x4004_080b 0x4004_081b 0x4004_082b 0x4004_083b 0x4004_080c 0x4004_081c ofdstat 0x4004_082c 0x4004_083c 0x4004_080d 0x4004_081d 0x4004_082d 0x4004_083d 0x4004_080e 0x4004_081e 0x4004_082e 0x4004_083e 0x4004_080f 0x4004_081f 0x4004_082f 0x4004_083f 25.2.12 [12] power on reset (por), voltage detecting circuit (vltd) address register name address register name address register name address register name 0x4004_0900 vdcr 0x4004_0910 0x4004_0920 0x4004_0930 0x4004_0901 0x4004_0911 0x4004_0921 0x4004_0931 0x4004_0902 0x4004_0912 0x4004_0922 0x4004_0932 0x4004_0903 0x4004_0913 0x4004_0923 0x4004_0933 0x4004_0904 vdsr 0x4004_0914 0x4004_0924 0x4004_0934 0x4004_0905 0x4004_0915 0x4004_0925 0x4004_0935 0x4004_0906 0x4004_0916 0x4004_0926 0x4004_0936 0x4004_0907 0x4004_0917 0x4004_0927 0x4004_0937 0x4004_0908 0x4004_0918 0x4004_0928 0x4004_0938 0x4004_0909 0x4004_0919 0x4004_0929 0x4004_0939 0x4004_090a 0x4004_091a 0x4004_092a 0x4004_093a 0x4004_090b 0x4004_091b 0x4004_092b 0x4004_093b 0x4004_090c 0x4004_091c 0x4004_092c 0x4004_093c 0x4004_090d 0x4004_091d 0x4004_092d 0x4004_093d 0x4004_090e 0x4004_091e 0x4004_092e 0x4004_093e 0x4004_090f 0x4004_091f 0x4004_092f 0x4004_093f
25 special function registers tmpm380/m382 tmpm380/m382 - 42 / 49 - 25.2.13 [13] multi purpose timer (pmd)[1/2] address register name address register name address register name address register name 0x4005_0400 mtpd0mden 0x4005_0410 mtpd0mdcnt 0x4005_0420 mtpd0cmpw 0x4005_0430 mtpd0emgrel 0x4005_0401 0x4005_0411 0x4005_0421 0x4005_0431 0x4005_0402 0x4005_0412 0x4005_0422 0x4005_0432 0x4005_0403 0x4005_0413 0x4005_0423 0x4005_0433 0x4005_0404 mtpd0portmd 0x4005_0414 mtpd0mdprd 0x4005_0424 reserved 0x4005_0434 mtpd0emgcr 0x4005_0405 0x4005_0415 0x4005_0425 reserved 0x4005_0435 0x4005_0406 0x4005_0416 0x4005_0426 reserved 0x4005_0436 0x4005_0407 0x4005_0417 0x4005_0427 reserved 0x4005_0437 0x4005_0408 mtpd0mdcr 0x4005_0418 mtpd0cmpu 0x4005_0428 mtpd0mdout 0x4005_0438 mtpd0emgst 0x4005_0409 0x4005_0419 0x4005_0429 0x4005_0439 0x4005_040a 0x4005_041a 0x4005_042a 0x4005_043a 0x4005_040b 0x4005_041b 0x4005_042b 0x4005_043b 0x4005_040c mtpd0cntsta 0x4005_041c mtpd0cmpv 0x4005_042c mtpd0mdpot 0x4005_043c reserved 0x4005_040d 0x4005_041d 0x4005_042d 0x4005_043d reserved 0x4005_040e 0x4005_041e 0x4005_042e 0x4005_043e reserved 0x4005_040f 0x4005_041f 0x4005_042f 0x4005_043f reserved address register name address register name address register name address register name 0x4005_0440 reserved 0x4005_0450 reserved 0x4005_0460 reserved 0x4005_0470 reserved 0x4005_0441 reserved 0x4005_0451 reserved 0x4005_0461 reserved 0x4005_0471 0x4005_0442 reserved 0x4005_0452 reserved 0x4005_0462 reserved 0x4005_0472 0x4005_0443 reserved 0x4005_0453 reserved 0x4005_0463 reserved 0x4005_0473 0x4005_0444 mtpd0dtr 0x4005_0454 reserved 0x4005_0464 reserved 0x4005_0474 reserved 0x4005_0445 0x4005_0455 reserved 0x4005_0465 0x4005_0475 0x4005_0446 0x4005_0456 reserved 0x4005_0466 0x4005_0476 0x4005_0447 0x4005_0457 reserved 0x4005_0467 0x4005_0477 0x4005_0448 mtpd0trgcmp0 0x4005_0458 mtpd0trgcr 0x4005_0468 reserved 0x4005_0478 reserved 0x4005_0449 0x4005_0459 0x4005_0469 0x4005_0479 0x4005_044a 0x4005_045a 0x4005_046a 0x4005_047a 0x4005_044b 0x4005_045b 0x4005_046b 0x4005_047b 0x4005_044c mtpd0trgcmp1 0x4005_045c mtpd0trgmd 0x4005_046c reserved 0x4005_047c reserved 0x4005_044d 0x4005_045d 0x4005_046d 0x4005_047d 0x4005_044e 0x4005_045e 0x4005_046e 0x4005_047e 0x4005_044f 0x4005_045f 0x4005_046f 0x4005_047f
tmpm380/m382 tmpm380/m382 - 43 / 49 - ? [13] multi purpose timer (pmd) [2/2] address register name address register name address register name address register name 0x4005_0480 reserved 0x4005_0490 reserved 0x4005_04a0 reserved 0x4005_04b0 reserved 0x4005_0481 0x4005_0491 0x4005_04a1 0x4005_04b1 0x4005_0482 0x4005_0492 0x4005_04a2 0x4005_04b2 0x4005_0483 0x4005_0493 0x4005_04a3 0x4005_04b3 0x4005_0484 reserved 0x4005_0494 reserved 0x4005_04a4 reserved 0x4005_04b4 reserved 0x4005_0485 0x4005_0495 0x4005_04a5 0x4005_04b5 0x4005_0486 0x4005_0496 0x4005_04a6 0x4005_04b6 0x4005_0487 0x4005_0497 0x4005_04a7 0x4005_04b7 0x4005_0488 reserved 0x4005_0498 reserved 0x4005_04a8 reserved 0x4005_04b8 reserved 0x4005_0489 0x4005_0499 0x4005_04a9 0x4005_04b9 0x4005_048a 0x4005_049a 0x4005_04aa 0x4005_04ba 0x4005_048b 0x4005_049b 0x4005_04ab 0x4005_04bb 0x4005_048c reserved 0x4005_049c reserved 0x4005_04ac reserved 0x4005_04bc reserved 0x4005_048d 0x4005_049d 0x4005_04ad 0x4005_04bd 0x4005_048e 0x4005_049e 0x4005_04ae 0x4005_04be 0x4005_048f 0x4005_049f 0x4005_04af 0x4005_04bf address register name address register name address register name address register name 0x4005_04c0 reserved 0x4005_04d0 reserved 0x4005_04e0 reserved 0x4005_04f0 reserved 0x4005_04c1 0x4005_04d1 0x4005_04e1 0x4005_04f1 0x4005_04c2 0x4005_04d2 0x4005_04e2 0x4005_04f2 0x4005_04c3 0x4005_04d3 0x4005_04e3 0x4005_04f3 0x4005_04c4 reserved 0x4005_04d4 reserved 0x4005_04e4 reserved 0x4005_04f4 reserved 0x4005_04c5 0x4005_04d5 0x4005_04e5 0x4005_04f5 0x4005_04c6 0x4005_04d6 0x4005_04e6 0x4005_04f6 0x4005_04c7 0x4005_04d7 0x4005_04e7 0x4005_04f7 0x4005_04c8 reserved 0x4005_04d8 reserved 0x4005_04e8 reserved 0x4005_04f8 reserved 0x4005_04c9 0x4005_04d9 0x4005_04e9 0x4005_04f9 0x4005_04ca 0x4005_04da 0x4005_04ea 0x4005_04fa 0x4005_04cb 0x4005_04db 0x4005_04eb 0x4005_04fb 0x4005_04cc reserved 0x4005_04dc reserved 0x4005_04ec reserved 0x4005_04fc reserved 0x4005_04cd 0x4005_04dd 0x4005_04ed 0x4005_04fd 0x4005_04ce 0x4005_04de 0x4005_04ee 0x4005_04fe 0x4005_04cf 0x4005_04df 0x4005_04ef 0x4005_04ff
25 special function registers tmpm380/m382 tmpm380/m382 - 44 / 49 - [13] multi purpose timer (tmr/igbt) [1/3] address register name address register name address register name address register name 0x4005_0800 mt0en 0x4005_0810 mt0tbffcr 0x4005_0820 mt0rg0 0x4005_0830 mt0igcr 0x4005_0801 0x4005_0811 0x4005_0821 0x4005_0831 0x4005_0802 0x4005_0812 0x4005_0822 0x4005_0832 0x4005_0803 0x4005_0813 0x4005_0823 0x4005_0833 0x4005_0804 mt0run 0x4005_0814 mt0tbst 0x4005_0824 mt0rg1 0x4005_0834 mt0igresta 0x4005_0805 0x4005_0815 0x4005_0825 0x4005_0835 0x4005_0806 0x4005_0816 0x4005_0826 0x4005_0836 0x4005_0807 0x4005_0817 0x4005_0827 0x4005_0837 0x4005_0808 mt0tbcr 0x4005_0818 mt0tbim 0x4005_0828 mt0cp0 0x4005_0838 mt0igst 0x4005_0809 0x4005_0819 0x4005_0829 0x4005_0839 0x4005_080a 0x4005_081a 0x4005_082a 0x4005_083a 0x4005_080b 0x4005_081b 0x4005_082b 0x4005_083b 0x4005_080c mt0tbmod 0x4005_081c mt0tbuc 0x4005_082c mt0cp1 0x4005_083c mt0igicr 0x4005_080d 0x4005_081d 0x4005_082d 0x4005_083d 0x4005_080e 0x4005_081e 0x4005_082e 0x4005_083e 0x4005_080f 0x4005_081f 0x4005_082f 0x4005_083f address register name address register name address register name address register name 0x4005_0840 mt0igocr 0x4005_0850 mt0igemgcr 0x4005_0860 reserved 0x4005_0870 reserved 0x4005_0841 0x4005_0851 0x4005_0861 0x4005_0871 0x4005_0842 0x4005_0852 0x4005_0862 0x4005_0872 0x4005_0843 0x4005_0853 0x4005_0863 0x4005_0873 0x4005_0844 mt0igrg2 0x4005_0854 mt0igemgst 0x4005_0864 reserved 0x4005_0874 reserved 0x4005_0845 0x4005_0855 0x4005_0865 0x4005_0875 0x4005_0846 0x4005_0856 0x4005_0866 0x4005_0876 0x4005_0847 0x4005_0857 0x4005_0867 0x4005_0877 0x4005_0848 mt0igrg3 0x4005_0858 reserved 0x4005_0868 reserved 0x4005_0878 reserved 0x4005_0849 0x4005_0859 0x4005_0869 0x4005_0879 0x4005_084a 0x4005_085a 0x4005_086a 0x4005_087a 0x4005_084b 0x4005_085b 0x4005_086b 0x4005_087b 0x4005_084c mt0igrg4 0x4005_085c reserv ed 0x4005_086c reserved 0x4005_087c reserved 0x4005_084d 0x4005_085d 0x4005_086d 0x4005_087d 0x4005_084e 0x4005_085e 0x4005_086e 0x4005_087e 0x4005_084f 0x4005_085f 0x4005_086f 0x4005_087f
tmpm380/m382 tmpm380/m382 - 45 / 49 - ? [13] multi purpose timer (tmr/igbt) [2/3] address register name address register name address register name address register name 0x4005_0880 reserved 0x4005_0890 reserved 0x4005_08a0 reserved 0x4005_08b0 reserved 0x4005_0881 0x4005_0891 0x4005_08a1 0x4005_08b1 0x4005_0882 0x4005_0892 0x4005_08a2 0x4005_08b2 0x4005_0883 0x4005_0893 0x4005_08a3 0x4005_08b3 0x4005_0884 reserved 0x4005_0894 reserved 0x4005_08a4 reserved 0x4005_08b4 reserved 0x4005_0885 0x4005_0895 0x4005_08a5 0x4005_08b5 0x4005_0886 0x4005_0896 0x4005_08a6 0x4005_08b6 0x4005_0887 0x4005_0897 0x4005_08a7 0x4005_08b7 0x4005_0888 reserved 0x4005_0898 reserved 0x4005_08a8 reserved 0x4005_08b8 reserved 0x4005_0889 0x4005_0899 0x4005_08a9 0x4005_08b9 0x4005_088a 0x4005_089a 0x4005_08aa 0x4005_08ba 0x4005_088b 0x4005_089b 0x4005_08ab 0x4005_08bb 0x4005_088c reserved 0x4005_089c reserved 0x4005_08ac reserved 0x4005_08bc reserved 0x4005_088d 0x4005_089d 0x4005_08ad 0x4005_08bd 0x4005_088e 0x4005_089e 0x4005_08ae 0x4005_08be 0x4005_088f 0x4005_089f 0x4005_08af 0x4005_08bf address register name address register name address register name address register name 0x4005_08c0 reserved 0x4005_08d0 reserved 0x4005_08e0 reserved 0x4005_08f0 reserved 0x4005_08c1 0x4005_08d1 0x4005_08e1 0x4005_08f1 0x4005_08c2 0x4005_08d2 0x4005_08e2 0x4005_08f2 0x4005_08c3 0x4005_08d3 0x4005_08e3 0x4005_08f3 0x4005_08c4 reserved 0x4005_08d4 reserved 0x4005_08e4 reserved 0x4005_08f4 reserved 0x4005_08c5 0x4005_08d5 0x4005_08e5 0x4005_08f5 0x4005_08c6 0x4005_08d6 0x4005_08e6 0x4005_08f6 0x4005_08c7 0x4005_08d7 0x4005_08e7 0x4005_08f7 0x4005_08c8 reserved 0x4005_08d8 reserved 0x4005_08e8 reserved 0x4005_08f8 reserved 0x4005_08c9 0x4005_08d9 0x4005_08e9 0x4005_08f9 0x4005_08ca 0x4005_08da 0x4005_08ea 0x4005_08fa 0x4005_08cb 0x4005_08db 0x4005_08eb 0x4005_08fb 0x4005_08cc reserved 0x4005_08dc reserved 0x4005_08ec reserved 0x4005_08fc reserved 0x4005_08cd 0x4005_08dd 0x4005_08ed 0x4005_08fd 0x4005_08ce 0x4005_08de 0x4005_08ee 0x4005_08fe 0x4005_08cf 0x4005_08df 0x4005_08ef 0x4005_08ff
25 special function registers tmpm380/m382 tmpm380/m382 - 46 / 49 - [13] multi purpose timer (tmr/igbt) [3/3] address register name address register name address register name address register name 0x4005_0900 reserved 0x4005_0910 reserved 0x4005_0920 reserved 0x4005_0930 reserved 0x4005_0901 0x4005_0911 0x4005_0921 0x4005_0931 0x4005_0902 0x4005_0912 0x4005_0922 0x4005_0932 0x4005_0903 0x4005_0913 0x4005_0923 0x4005_0933 0x4005_0904 reserved 0x4005_0914 reserved 0x4005_0924 reserved 0x4005_0934 reserved 0x4005_0905 0x4005_0915 0x4005_0925 0x4005_0935 0x4005_0906 0x4005_0916 0x4005_0926 0x4005_0936 0x4005_0907 0x4005_0917 0x4005_0927 0x4005_0937 0x4005_0908 reserved 0x4005_0918 reserved 0x4005_0928 reserved 0x4005_0938 reserved 0x4005_0909 0x4005_0919 0x4005_0929 0x4005_0939 0x4005_090a 0x4005_091a 0x4005_092a 0x4005_093a 0x4005_090b 0x4005_091b 0x4005_092b 0x4005_093b 0x4005_090c reserved 0x4005_091c reserved 0x4005_092c reserved 0x4005_093c reserved 0x4005_090d 0x4005_091d 0x4005_092d 0x4005_093d 0x4005_090e 0x4005_091e 0x4005_092e 0x4005_093e 0x4005_090f 0x4005_091f 0x4005_092f 0x4005_093f address register name address register name address register name address register name 0x4005_0940 reserved 0x4005_0950 reserved 0x4005_0960 reserved 0x4005_0970 reserved 0x4005_0941 0x4005_0951 0x4005_0961 0x4005_0971 0x4005_0942 0x4005_0952 0x4005_0962 0x4005_0972 0x4005_0943 0x4005_0953 0x4005_0963 0x4005_0973 0x4005_0944 reserved 0x4005_0954 reserved 0x4005_0964 reserved 0x4005_0974 reserved 0x4005_0945 0x4005_0955 0x4005_0965 0x4005_0975 0x4005_0946 0x4005_0956 0x4005_0966 0x4005_0976 0x4005_0947 0x4005_0957 0x4005_0967 0x4005_0977 0x4005_0948 reserved 0x4005_0958 reserved 0x4005_0968 reserved 0x4005_0978 reserved 0x4005_0949 0x4005_0959 0x4005_0969 0x4005_0979 0x4005_094a 0x4005_095a 0x4005_096a 0x4005_097a 0x4005_094b 0x4005_095b 0x4005_096b 0x4005_097b 0x4005_094c reserved 0x4005_095c reserved 0x4005_096c reserved 0x4005_097c reserved 0x4005_094d 0x4005_095d 0x4005_096d 0x4005_097d 0x4005_094e 0x4005_095e 0x4005_096e 0x4005_097e 0x4005_094f 0x4005_095f 0x4005_096f 0x4005_097f
tmpm380/m382 tmpm380/m382 - 47 / 49 - ? 25.2.14 [15] dma controller (dmac) address register name address register name address register name address register name 0x4008_0000 dmacint 0x4008_0010 dmacint 0x4008_0020 dmacsoftb 0x4008_0030 dmac 0x4008_0001 status 0x4008_0011 errclr 0x4008_0021 req 0x4008_0031 configuration 0x4008_0002 0x4008_0012 0x4008_0022 0x4008_0032 0x4008_0003 0x4008_0013 0x4008_0023 0x4008_0033 0x4008_0004 dmacinttc 0x4008_0014 dmacrawint 0x4008_0024 dmacsofts 0x4008_0034 reserved 0x4008_0005 status 0x4008_0015 tcstatus 0x4008_0025 req 0x4008_0035 0x4008_0006 0x4008_0016 0x4008_0026 0x4008_0036 0x4008_0007 0x4008_0017 0x4008_0027 0x4008_0037 0x4008_0008 dmacinttc 0x4008_0018 dmacrawint 0x4008_0028 reserved 0x4008_0038 reserved 0x4008_0009 clear 0x4008_0019 errorstatus 0x4008_0029 0x4008_0039 0x4008_000a 0x4008_001a 0x4008_002a 0x4008_003a 0x4008_000b 0x4008_001b 0x4008_002b 0x4008_003b 0x4008_000c dmacint 0x4008_001c dmacenbld 0x4008_002c reserved 0x4008_003c reserved 0x4008_000d errorstatus 0x4008_001d chns 0x4008_002d 0x4008_003d 0x4008_000e 0x4008_001e 0x4008_002e 0x4008_003e 0x4008_000f 0x4008_001f 0x4008_002f 0x4008_003f address register name address register name address register name address register name 0x4008_0100 dmacc0src 0x4008_0110 dmacc0 0x4008_0120 dmacc1src 0x4008_0130 dmacc1 0x4008_0101 addr 0x4008_0111 configuratio n 0x4008_0121 addr 0x4008_0131 configuration 0x4008_0102 0x4008_0112 0x4008_0122 0x4008_0132 0x4008_0103 0x4008_0113 0x4008_0123 0x4008_0133 0x4008_0104 dmacc0dest 0x4008_0114 reserved 0x4008_0124 dmacc1dest 0x4008_0134 reserved 0x4008_0105 addr 0x4008_0115 0x4008_0125 addr 0x4008_0135 0x4008_0106 0x4008_0116 0x4008_0126 0x4008_0136 0x4008_0107 0x4008_0117 0x4008_0127 0x4008_0137 0x4008_0108 dmacc0lli 0x4008_0118 reserved 0x4008_0128 dmacc1lli 0x4008_0138 reserved 0x4008_0109 0x4008_0119 0x4008_0129 0x4008_0139 0x4008_010a 0x4008_011a 0x4008_012a 0x4008_013a 0x4008_010b 0x4008_011b 0x4008_012b 0x4008_013b 0x4008_010c dmacc0 0x4008_011c reserved 0x4008_012c dmacc1 0x4008_013c reserved 0x4008_010d control 0x4008_011d 0x4008_012d control 0x4008_013d 0x4008_010e 0x4008_011e 0x4008_012e 0x4008_013e 0x4008_010f 0x4008_011f 0x4008_012f 0x4008_013f
25 special function registers tmpm380/m382 tmpm380/m382 - 48 / 49 - 25.2.15 [15] ssp controller address register name address register name address register name address register name 0x400c_0000 ssp0cr0 0x400c_0010 ssp0cpsr 0x400c_0020 ssp0icr 0x400c_0030 reserved 0x400c_0001 0x400c_0011 0x400c_0021 0x400c_0031 0x400c_0002 0x400c_0012 0x400c_0022 0x400c_0032 0x400c_0003 0x400c_0013 0x400c_0023 0x400c_0033 0x400c_0004 ssp0cr1 0x400c_0014 ssp0imsc 0x 400c_0024 ssp0dmacr 0x400c_0034 reserved 0x400c_0005 0x400c_0015 0x400c_0025 0x400c_0035 0x400c_0006 0x400c_0016 0x400c_0026 0x400c_0036 0x400c_0007 0x400c_0017 0x400c_0027 0x400c_0037 0x400c_0008 ssp0dr 0x400c_0018 ssp0ris 0x400c_0028 reserved 0x400c_0038 reserved 0x400c_0009 0x400c_0019 0x400c_0029 0x400c_0039 0x400c_000a 0x400c_001a 0x400c_002a 0x400c_003a 0x400c_000b 0x400c_001b 0x400c_002b 0x400c_003b 0x400c_000c ssp0sr 0x400c_001c ssp0mis 0x400c_002c reserved 0x400c_003c reserved 0x400c_000d 0x400c_001d 0x400c_002d 0x400c_003d 0x400c_000e 0x400c_001e 0x400c_002e 0x400c_003e 0x400c_000f 0x400c_001f 0x400c_002f 0x400c_003f address register name address register name address register name address register name 0x400c_1000 reserved 0x400c_1010 reserved 0x400c_1020 reserved 0x400c_1030 reserved 0x400c_1001 0x400c_1011 0x400c_1021 0x400c_1031 0x400c_1002 0x400c_1012 0x400c_1022 0x400c_1032 0x400c_1003 0x400c_1013 0x400c_1023 0x400c_1033 0x400c_1004 reserved 0x400c_1014 reserved 0x400c_1024 reserved 0x400c_1034 reserved 0x400c_1005 0x400c_1015 0x400c_1025 0x400c_1035 0x400c_1006 0x400c_1016 0x400c_1026 0x400c_1036 0x400c_1007 0x400c_1017 0x400c_1027 0x400c_1037 0x400c_1008 reserved 0x400c_1018 reserved 0x400c_1028 reserved 0x400c_1038 reserved 0x400c_1009 0x400c_1019 0x400c_1029 0x400c_1039 0x400c_100a 0x400c_101a 0x400c_102a 0x400c_103a 0x400c_100b 0x400c_101b 0x400c_102b 0x400c_103b 0x400c_100c reserved 0x400c_101c reserv ed 0x400c_102c reserved 0x400c_103c reserved 0x400c_100d 0x400c_101d 0x400c_102d 0x400c_103d 0x400c_100e 0x400c_101e 0x400c_102e 0x400c_103e 0x400c_100f 0x400c_101f 0x400c_102f 0x400c_103f
tmpm380/m382 tmpm380/m382 - 49 / 49 - ? 25.2.16 [16] flash controller address register name address register name address register name address register name 0x41ff_f000 reserved 0x41ff_f010 fcsecbit 0x41ff_f020 fcflcs 0x41ff_f030 reserved 0x41ff_f001 0x41ff_f011 0x41ff_f021 0x41ff_f031 0x41ff_f002 0x41ff_f012 0x41ff_f022 0x41ff_f032 0x41ff_f003 0x41ff_f013 0x41ff_f023 0x41ff_f033 0x41ff_f004 reserved 0x41ff_f014 reserved 0x41ff_f024 reserved 0x41ff_f034 reserved 0x41ff_f005 0x41ff_f015 0x41ff_f025 0x41ff_f035 0x41ff_f006 0x41ff_f016 0x41ff_f026 0x41ff_f036 0x41ff_f007 0x41ff_f017 0x41ff_f027 0x41ff_f037 0x41ff_f008 reserved 0x41ff_f018 reserved 0x41ff_f028 reserved 0x41ff_f038 reserved 0x41ff_f009 0x41ff_f019 0x41ff_f029 0x41ff_f039 0x41ff_f00a 0x41ff_f01a 0x41ff_f02a 0x41ff_f03a 0x41ff_f00b 0x41ff_f01b 0x41ff_f02b 0x41ff_f03b 0x41ff_f00c reserved 0x41ff_f01c reserved 0x41ff_f02c reserved 0x41ff_f03c reserved 0x41ff_f00d 0x41ff_f01d 0x41ff_f02d 0x41ff_f03d 0x41ff_f00e 0x41ff_f01e 0x41ff_f02e 0x41ff_f03e 0x41ff_f00f 0x41ff_f01f 0x41ff_f02f 0x41ff_f03f address register name address register name address register name address register name 0x41ff_f040 reserved 0x41ff_f050 reserved 0x41ff_f060 reserved 0x41ff_f070 reserved 0x41ff_f041 0x41ff_f051 0x41ff_f061 0x41ff_f071 0x41ff_f042 0x41ff_f052 0x41ff_f062 0x41ff_f072 0x41ff_f043 0x41ff_f053 0x41ff_f063 0x41ff_f073 0x41ff_f044 reserved 0x41ff_f054 reserved 0x41ff_f064 reserved 0x41ff_f074 reserved 0x41ff_f045 0x41ff_f055 0x41ff_f065 0x41ff_f075 0x41ff_f046 0x41ff_f056 0x41ff_f066 0x41ff_f076 0x41ff_f047 0x41ff_f057 0x41ff_f067 0x41ff_f077 0x41ff_f048 reserved 0x41ff_f058 reserved 0x41ff_f068 reserved 0x41ff_f078 reserved 0x41ff_f049 0x41ff_f059 0x41ff_f069 0x41ff_f079 0x41ff_f04a 0x41ff_f05a 0x41ff_f06a 0x41ff_f07a 0x41ff_f04b 0x41ff_f05b 0x41ff_f06b 0x41ff_f07b 0x41ff_f04c reserved 0x41ff_f05c reserved 0x41ff_f06c reserved 0x41ff_f07c reserved 0x41ff_f04d 0x41ff_f05d 0x41ff_f06d 0x41ff_f07d 0x41ff_f04e 0x41ff_f05e 0x41ff_f06e 0x41ff_f07e 0x41ff_f04f 0x41ff_f05f 0x41ff_f06f 0x41ff_f07f address register name address register name address register name address register name 0x41ff_f080 reserved 0x41ff_f090 reserved 0x41ff_f0a0 reserved 0x41ff_f0b0 reserved 0x41ff_f081 0x41ff_f091 0x41ff_f0a1 0x41ff_f0b1 0x41ff_f082 0x41ff_f092 0x41ff_f0a2 0x41ff_f0b2 0x41ff_f083 0x41ff_f093 0x41ff_f0a3 0x41ff_f0b3 0x41ff_f084 reserved 0x41ff_f094 reserved 0x41ff_f0a4 reserved 0x41ff_f0b4 reserved 0x41ff_f085 0x41ff_f095 0x41ff_f0a5 0x41ff_f0b5 0x41ff_f086 0x41ff_f096 0x41ff_f0a6 0x41ff_f0b6 0x41ff_f087 0x41ff_f097 0x41ff_f0a7 0x41ff_f0b7 0x41ff_f088 reserved 0x41ff_f098 reserved 0x41ff_f0a8 reserved 0x41ff_f0b8 reserved 0x41ff_f089 0x41ff_f099 0x41ff_f0a9 0x41ff_f0b9 0x41ff_f08a 0x41ff_f09a 0x41ff_f0aa 0x41ff_f0ba 0x41ff_f08b 0x41ff_f09b 0x41ff_f0ab 0x41ff_f0bb 0x41ff_f08c reserved 0x41ff_f09c reserved 0x41ff_f0ac reserved 0x41ff_f0bc reserved 0x41ff_f08d 0x41ff_f09d 0x41ff_f0ad 0x41ff_f0bd 0x41ff_f08e 0x41ff_f09e 0x41ff_f0ae 0x41ff_f0be 0x41ff_f08f 0x41ff_f09f 0x41ff_f0af 0x41ff_f0bf
tmpm380/382 tmpm380/382 - 1 / 4 - 26 port section equivalent circuit schematics ? how to read the schematics basically, the gate symbols written are the same as those used for the standard cmos logic ic [74hcxx] series. the input protection resistance ranges from several tens of ohms to several hundreds of ohms. damping resistor and f eedback resistor are shown with a typical value. ? pa0-7, pb0-7, pc0-7, pd0-6, pe0-7, pf0-4, pg0-7, pl2, pn0-7 schmitt i/o output data output enable input data pull-up enable p-ch n-ch input enable pull-down enable programmable pull-up resistor programmable pull-down resistor ? ph0-7, pi0-1, pj0-7 p-ch n-ch input ain schmitt i/o output data output enable input data pull-up enable input enable pull-down enable programmable pull-up resistor programmable pull-down resistor output control output control important tmpm382 (64-pin version) does not have pd0-6,pe6,pe7,pf2-4,pg0-7,pj0-7,pn0-7 total 36 pins.
26 port section equivalent circuit schematic tmpm380/m382 tmpm380/m382 - 2 / 4 - ? pm0-1, pp0-1 p-ch n-ch oscillator schmitt i/o output data output enable input data pull-up enable input enable pull-down enable programmable pull-up resistor programmable pull-down resistor ? pl0 p-ch n-ch schmitt output output data output enable boot pull-up enable input enable pull-down enable programmable pull-up resistor programmable pull-down resistor output control
tmpm380/382 tmpm380/382 - 3 / 4 - ? x1, x2 oscillator circuit x2 high-frequenc y oscillation enable x1 clock 1 k typ. 500 k typ. ? xt1, xt2 oscillator circuit xt2 low-frequency oscillation enable xt1 clock 12 120 k typ. 52 20m typ. ? reset schimitt input reset pull-up resistor ? mode schimitt input mode ? ftest3 schimitt open ftest3 note : mode must be connected with gnd. note : ftest3 must be open.
26 port section equivalent circuit schematic tmpm380/m382 tmpm380/m382 - 4 / 4 - ? avdd5(vrefh), avss(vrefl) avdd5 vrefh vrefl avss string resistor avdd5(vrefh) avss(vrefl) adc
tmpm380/m382 tmpm380/m382 - 1 / 21 - ?? ? 27 electrical characteristics 27.1 absolute maximum ratings parameter symbol rating unit dvdd5 ? 0.3 to 6.0 ? rvdd5 ? 0.3 to 6.0 ? supply voltage avdd5 ? 0.3 to 6.0 ? v input voltage vin ? 0.3 to vdd+0.3 v per pin i ol 5 low-level output current total i ol 50 per pin i oh ? 5 high-level output current total i oh ? 50 ma power consumption (ta = 85c) pd 600 mw soldering temperature (10s) t solder 260 c storage temperature t stg ? 55 to 125 c except during flash w/e ? 40 to 85 operating temperature during flash w/e t opr 0 to 70? c (note) ? absolute maximum ratings are limiting values of operating and environmental conditions which should not be exceeded under the worst possible conditions. the equipment manufacturer should design so that no absolute maximum rating value is exceeded with respect to current, voltage, power consumption, temperature, etc. exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to ic blowup and/or burning. ?
27 electrical characteristics tmpm380/382 tmpm380/382 - 2 / 21 - ? 27.2 dc electrical characteristics (1/3) ta= -40 to 85 c parameter symbol condition min typ. (note 1) max unit supply voltage (note 2 dvdd5 avdd5 rvdd5 dvdd5 = rvdd5 =avdd5 dvss = avss = 0v fosc = 8 ~ 10mhz fsys = 1 ~ 40mhz fs = 30 ~ 34khz 4.0 5.5 v capacitance for vout3 (note 3) cout dvdd5=4.0 to 5.5v 3.3 4.7 f vil1 dvdd5=4.0 to 5.5v (port a/b/c/d/e/f/g/l/m/n/p) -0.3 0.25 dvdd5 v low-level input voltage vil2 avdd5=4.0 to 5.5v (port h/i/j) -0.3 0.25 avdd5 v vih1 dvdd5=4.0 to 5.5v (port a/b/c/d/e/f/g/l/m/n/p) 0.75 dvdd5 dvdd5 0.3 v high-level input voltage vih2 avdd5=4.0 to 5.5v (port h/i/j) 0.75 avdd5 avdd5 0.3 v vol1 dvdd5? 4.0v iol = 1.6ma (port a/b/c/d/e/f/g/l/m/n/p) 0.4 v low-level output voltage vol2 avdd5 ?4.0v iol = 1.6ma (port h/i/j) 0.4 v voh1 dvdd5? 4.0v ioh =?1.6ma (port a/b/c/d/e/f/g/l/m/n/p) dvdd5 0.4 v high-level output voltage voh2 avdd5 ?4.0v ioh =?1.6ma (port h/i/j) avdd5 0.4 v input leakage current ili 0.0v ? vin ? dvdd5 0.0v ? vin ? avdd5 0.02 5 a output leakage current ilo 0.2v ? vin ? dvdd 5? 0.2v 0.2v ? vin ? avdd5 ? 0.2v 0.05 10 a pull-up resister at reset rrst 4.0v ? dvdd5 ?5.5v 38.5 50 71.4 k ? schmitt-triggered port vth 4.0v ? dvdd5 ?5.5v 4.0v ? avdd5 ?5.5v 0.3 0.6 v programmable pull-up/ pull-down resistor pkh 4.0v ? dvdd5 ?5.5v 4.0v ? avdd5 ?5.5v 38.5 50 71.4 k ? pin capacitance (except power supply pins) c io fc = 1mhz 10 pf (note 1) ta = 25 c , dvdd5 = avdd5 = rvdd5 = 5v, unless otherwise noted. (note 2) the same voltage must be supplied to dvdd5, avdd5 and rvdd5. (note 3) vout3 pin should be connected to gnd via a capacitance.
tmpm380/m382 tmpm380/m382 - 3 / 21 - ?? ? 27.3 dc electrical characteristics (2/3) ta 40 to 85 dvdd5=rvdd5=avdd5=4.0 to 5.5v parameter symbol condition min typ. max unit iol per pin 2 ma iol1 per group 4.0v Q dvdd5 Q5.5v grl1 = grl2 = grl3 = grl4 = 20 ma iol2 per group 4.0v Q avdd5 Q5.5v grl5 = 9 ma low-level output current iol total of all pins 30 ma ioh per pin -2 ma ioh1 per groups 4.0v Qdvdd5Q 5.5v grh1 = grh2 = grh3 = -20 ma ioh2 per groups 4.0v Q avdd5Q 5.5v grh4 = -9 ma high-level output current ioh total of all pins -30 ma (note ) current can flow capacity in each condition . 27.4 dc electrical characteristics (3/3) ta 40 to 85 dvdd5=rvdd5=avdd5=4.0 to 5.5v parameter symbol condition min typ. (note 1) max unit normal (note 2) 25 33 idle (note 3) fsys = 40mhz (fosc = 10mhz, gear 1/1) 19 26 ma slow 382 1850 a sleep (note 4) fs=32.768khz 122 800 a stop 96 750 a flash write erase current i dd 25 35 ma (note 1) ta = 25c, dvdd5 = avdd5 = rvdd5 = 5v, unless otherwise noted. (note 2) i dd normal: measured with the dhrystone ver. 2.1 operated in flash. all functions operates excluding a/d. (note 3) i dd idle:measured with cpu is stopped, some of the periperal is running. (note 4) i dd sleep:measured with cpu is stopped using rmc rtc only.
27 electrical characteristics tmpm380/382 tmpm380/382 - 4 / 21 - ? 27.5 12-bit adc electrical characteristics ta 40 85 , dvdd5 = rvdd5 4.5v 5.5v, dvss=avss=0v parameter symbol condit ion min typ. max unit analog supply voltage note avdd5 avdd5=v refh dvdd5 0.2 dvdd5 v analog reference voltage avss avss=v refl 0 0 v analog input voltage v ain avss avdd5 v iref on (during ad conversion) 7.5 10.0 ma iref on(during ad stop) 3.5 5 ma analog reference supply current note4 i ref iref off(during stop mode) 3 70 inl error 9 dnl error 6 1 offset error 5 full-scale error 8 2 total error 12bit mode ain resistance Q600? ain load capacitance Q0.1 f conversion time R1.85 s 128 lsb (note2) inl error 3 dnl error 2 offset error 3 full-scale error 3 total error 10bit mode ain resistance Q600? ain load capacitance Q0.1 f conversion time R1.70 s 4 lsb (note3) (note 1) a/d when using separate power supply for the converter, you must keep this condition. (note 2) 1lsb = (avdd5 ? avss) / 4096[v] (note 3) 1lsb = (avdd5 ? avss) / 1024[v] (note 4) the relevant pin for i ref is avdd5, so that the current flowing into avdd5 is the power supply current avdd5 + i ref . (note) peripheral functions are disable.
tmpm380/m382 tmpm380/m382 - 5 / 21 - ?? ? ? 27.6 ac electrical characteristics 27.6.1 ac measurement condision the ac characteristics data of this chapter is measured under the following conditions unless otherwize noted. ?? output levels: high 0.8 dvdd5, low 0.2 dvdd5 ?? input levels: refer to low-level input voltage an d high-level input voltage in dc electrical characteristics. ?? load capacity : cl=30pf ?? ta : -40 to 85 (note)the ?equation? column in the table shows the specifications under th e conditions dvdd5 = 4.0 to 5.5 v. 27.6.2 serial channel timing (uart/sio) (1) i/o interface mode in the table b e low, the letter x represents the sio oper ation clock cycle time which is identical to the fsys cycle time. it varies depending on the programming of the clock gear function. 1) sclk input mode equation 40 mhz parameter symbol min max min max unit sclk clock high width (input) t sch 3x - 75 - sclk clock low width (input) t scl 3x - 75 - sclk cycle t scy t sch + t scl - 150 - txd to sclk rise or fall (note 1) t oss t scy /2 ? 3x - 45 - -45 (note 2) - txd hold or fall after sclk rising (note 1) t ohs t scy /2 - 75 - rxd valid to sclk rise or fall (note 1) t srd 30 - 30 - rxd hold or fall after sclk rising (note 1) t hsr x + 30 - 55 - ns (note 1) sclk rise or fall: measured relati ve to the programmed active edge of sclk. (note 2) keep this value positive by adjusting sclk cycle.
27 electrical characteristics tmpm380/382 tmpm380/382 - 6 / 21 - ? 2) sclk output mode equation 40 mhz parameter symbol min max min max unit sclk cycle (programmable) t scy 4x - 100 - output data sclk rise t oss t scy /2 - 20 - 30 - sclk rise output hold data hold t ohs t scy /2 - 20 - 30 - valid data input sclk rise t srd 45 - 45 - sclk rise input data hold t hsr 0 - 0 - ns ou tput d ata txd input data rxd sclk output mode/ input rising mode 0 valid t oss t scy t ohs 1 2 3 t sr d t hsr 0 1 2 3 va lid valid val id sclk input falling mode t sch t scl
tmpm380/m382 tmpm380/m382 - 7 / 21 - ?? ? 27.6.3 serial bus interface i2c/sio (1) i2c mode in the table b e low, the letter x represents the i2c operation clock cycle time which is identical to the fsys cycle time. it varies depending on the programming of the clock gear function. n denotes the value of n programmed into the sc k (scl output frequency select) field in the sbincr. equation standard mode fast mode parameter symbol min max min max min max unit scl clock frequency t scl 0 - 0 100 0 400 khz hold time for start condition t hd:sta - - 4.0 - 0.6 - s scl low width (input) (note 1) t low - - 4.7 - 1.3 - s scl high width (input) (note 2) t high - - 4.0 - 0.6 - s setup time for a repeated start condition t su;sta (note 5) - 4.7 - 0.6 - s data hold time (input) (note 3, 4) t hd;dat - - 0.0 - 0.0 - s data setup time t su;dat - - 250 - 100 - ns setup time for a stop condition t su;sto - - 4.0 - 0.6 - s bus free time between stop condition and start condition t buf (note 5) - 4.7 - 1.3 - s (note 1) scl clock low width (output) is calculated with: (2 n-1 +58)/x (note 2) scl clock high width (output) is calculated with: (2 n-1 +12)/x (note 3) the output data hold time is equal to 12x of internal scl. (note 4) the philips i2c-bus specificati on states that a device must interna lly provide a hold time of at least 300 ns for the sda signal to bridge the undefined r egion of the falling edge of scl. however, this sbi does not satisfy this requirement. also, the output buf fer for scl does not incorporate slope control of the falling edges; therefore, the equipment manufactur er should design so that the input data hold time shown in the table is satisfied, including tr/tf of the scl and sda lines. (note 5) software-dependent. (note 6) the philips i2c-bus specification instructs that if the power supply to a fast-mode device is switched off, the sda and scl i/o pins must be floating so t hat they don?t obstruct the bus lines. however, this sbi does not satisfy this requirement. sda scl t low t hd;sta t scl t high t r t su;da t t hd ;d at t su;sta t su;sto t buf s: start condition sr: repeated start condition p: stop condition t f s sr p ? notice: on i2c-bus specification, maximum speed of standard mode is 100khz, fast mode is 400khz. internal scl fre q uenc y settin g should com p l y with note1 & note2 shown above.
27 electrical characteristics tmpm380/382 tmpm380/382 - 8 / 21 - ? (2) clock-synchronous 8-bit sio mode in the table b e low, the letter x represents the i2c operation clock cycle time which is identical to the fsys cycle time. it varies depending on the programming of the clock gear function. the electrical specifications below are for an sck signal with a 50% duty cycle. 1) sck input mode equation 40mhz parameter symbol min max min max unit sck clock high width (input) t sch 4x - 100 - sck clock low width (input) t scl 4x - 100. - sck cycle t scy 8x - 200 - output data  sck rise t oss t scy /2 - 3x - 45 - -20 note - sck rise  output data hold t ohs t scy /2 + 2x - 25 - 125 - valid data input  sck rise t srd 30 - x - 5 - sck rise  input data hold t hsr 30 - 30 - ns (note) keep this value positive by adjusting sck cycle. 2) sck output mode equation 40mhz parameter symbol min max min max unit sck cycle (programmable) t scy 16x - 400 - output data  sck rise t oss t scy /2 ? 20 - 180 - sck rise  output data hold t ohs t scy /2 ? 20 - 180 - valid data input  sck rise t srd 45 - 45 - sck rise  input data hold t hsr 0 - 0 - ns output data so input dat a si sck 0 va lid t oss t scy t ohs 1 2 3 t srd t hsr 0 1 2 3 valid va lid va lid t sch t scl
tmpm380/m382 tmpm380/m382 - 9 / 21 - ?? ? 27.6.4 spp controllor (ssp) ac measurement conditions z the letter ?t? used in the equation in the table represents the period of internal bus requency(fpclk) z output level: high=0.7dvdd5, low =0.3dvdd5 z input level: high=0.9dvdd5, low =0.1dvdd5 z load capacitance cl = 30 pf z ta = -45 to 85 ? ( note )the ?equation? column in the table shows t he specifications under the conditions dvdd5 = 4.0 to 5.5 v. equation parameter symbol min max fsys 40mhz (m=4 n=12) unit spxclk period (master) t m (m)t however more than 100ns 100 (10mhz) spxclk period (slave) t s (n)t 300 (3.3mhz) spxclk rise up time t r 15.0 15.0 spxclk fall down time t f 15.0 15.0 master mode: spxclk low level pulse width t wlm (m)t / 2 - 20.0 30 master mode: spxclk high level pulse width t whm (m)t / 2 ?20.0 30 slave mode: spxclk low level pulse width t wls (n)t / 2 ?10.0 145 slave mode: spxclk high level pulse width t whs (n)t / 2 ?10.0 145 master mode: spxclk rise/fall to output data valid t odsm 15.0 15.0 master mode: spxclk rise/fall to output data hold t odhm (m)t/2 -15 35.0 master mode: spxclk rise/fall to input data valid delay time t idsm 35.0 35.0 master mode: spxclk rise/fall to input data hold t idhm 5.0 5.0 master mode: spxfss valid to spxclk rise/fall t ofsm (m)t -15 (m)t+15 85 ? 115 slave mode: spxclk rise/fall to output data valid delay time t odss (3t) + 35 110 slave mode: spxclk rise/fall to output data hold t odhs (n)t /2 (2t) 200 slave mode: spxclk rise/fall to input data valid delay time t idss 10 10 slave mode: spxclk rise/fall to input data hold t idhs (3t) +15 90 slave mode: spxfss valid to spxclk rise/fall t ofss (n)t -20 280 ns (note) baud rate clcok is set under below condition master mode m = ( (1+)) = f sys spxclk is set only even number and ?m? must set during 65204 m 2 slave mode n = f sys spxclk (65024 ? n ? 12 )
27 electrical characteristics tmpm380/382 tmpm380/382 - 10 / 21 - ? ssp spi mode master f sys ? 2 spxclk(max) f sys ? 65024 spxclk(min) (1) master ssp0cr0 = ?0?( data is latched on the first edge ) sp0clk output master (ssp0cr0 = ?0? ) sp0do output t m t r t f 0.3 dvdd5 0.7 dvdd5 t wl t wh t idsm t idhm sp0di input sp0clk output master (ssp0cr0 = ?1? ) sp0fss output t ofsm t odsm t odhm t odsm internal clock state internal clock state ssp spi mode master (2) master ssp0cr0 = ?1? (data is latched on the second edge)) sp0clk output master (ssp0cr0 = ?1?) t m t r t f t wl t wh t idsm t idhm sp0clkoutput master (ssp0cr0 = ?0?) sp0fss output t ofsm sp0do output sp0di input t odsm t odhm 0.3 dvdd5 0.7 dvdd5
tmpm380/m382 tmpm380/m382 - 11 / 21 - ?? ? ssp spi mode(slave) f sys ? 12 spxclk (max) f sys ? 65024 spxclk (min) (3) slave ssp0cr0 = ?0?(data is latched on the first edge) sp0clk input (ssp0cr0 = ?0?) t s t r t f t wl t wh t idss t idhs sp0clk input (ssp0cr0 = ?1?) sp0fss input t ofss t odss t odhs sp0di input sp0do output 0.3 dvdd5 0.7 dvdd5 ssp spi mode(slave) (4) slave ssp0cr0 = ?1? (data is latched on the second edge)) sp0clk input (ssp0cr0 = ?1?) sp0clk input (ssp0cr0 = ?0?) sp0fss input sp0di input sp0do output t s t r t f t wl t wh t idss t idhs t ofss t odss t odhs 0.3 dvdd5 0.7 dvdd5
27 electrical characteristics tmpm380/382 tmpm380/382 - 12 / 21 - ? 27.6.5 event counter (tmrb) in the table below, the letter x represents the tmrb operation clock cycle time which is identical to the fsys cycle time. it varies depending on t he programming of the clock gear function. equation 40mhz parameter symbol min max min max unit clock low pulse width t vckl 2x + 100 - 150 - ns clock high pulse width t vckh 2x + 100 - 150 - ns 27.6.6 capture (tmrb) in the table below, the letter x represents the tmrb operation clock cycle time which is identical to the fsys cycle time. it varies depending on t he programming of the clock gear function. equation 40mhz parameter symbol min max min max unit low pulse width t cpl 2x + 100 - 150 - ns high pulse width t cph 2x + 100 - 150 - ns 27.6.7 general interrupts (int) in the table below, the letter x represents the fsys cycle time. equation 40mhz parameter symbol min max min max unit low pulse width for int0 to intf t cpl x + 100 - 125 - ns high pulse width for int0 to intf t cph x + 100 - 125 - ns 27.6.8 stop release interrupts equation 40mhz parameter symbol min max min max unit low pulse width for int0 to intf t intbl 100 - 100 - ns high pulse width for int0 to intf t intbh 100 - 100 - ns 27.6.9 scout pin ac characteristic equation 40mhz parameter symbol min max min max unit high pulse width t sch 0.5t - 5 7.5 ns low pulse width t scl 0.5t - 5 7.5 ns (note) in the above table, the letter t represent s the cycle time of t he scout output clock. t sch t scl scout
tmpm380/m382 tmpm380/m382 - 13 / 21 - ?? ? 27.6.10 debug communication (1) swd interface parameter symbol min max unit clk cycle tdck 100 - ns clk rise output data hold td1 4 - ns clk fall output data hold td2 - 37 ns clk fall output data hold tds 20 - ns clk rise input data hold tdh 15 - ns (2) jtag interface parameter symbol min max unit clk cycle tdck 100 - ns clk rise output data hold td3 4 - ns clk fall output data hold td4 - 37 ns input data valid clk rise tds 20 - ns clk rise input data hold tdh 15 - ns ? in put dat a (swdio) (tms/tdi) clk (swclk) (tck) t dck output data (swdio) t ds t d h output data (tdo) t d1 t d2 t d3 t d4
27 electrical characteristics tmpm380/382 tmpm380/382 - 14 / 21 - ? 27.6.11 etm trace ac measurement conditions ?? output levels: high 0.7 dvdd5, low 0.3 dvdd5 ?? load capacity : traceclk cl=25pf, tracedata cl=20pf parameter symbol min max unit traceclk cycle t tclk 50 - ns tracedata valid traceclk rise t setupr 2 - ns traceclk rise  tracedata hold t holdr 1 - ns tracedata valid traceclk fall t setupf 2 - ns traceclk fall  tracedata hold t holdf 1 - ns tracedata 0 ~ 1 traceclk 0 t setupf t tclk t h o l df 1 2 3 t setup r t h o l dr
tmpm380/m382 tmpm380/m382 - 15 / 21 - ?? ? 27.7 flash characteristics ta 0 to 70 parameter condition min typ. max unit flash memory erase / write times 100 times
27 electrical characteristics tmpm380/382 tmpm380/382 - 16 / 21 - ? 27.8 internal oscillator parameter symbol condit ion min typ. max unit oscillation frequency fosc2 ta 25 - 9.0 - mhz oscillation accuracy ta -40 85 -15 - +15 %
tmpm380/m382 tmpm380/m382 - 17 / 21 - ?? ? 27.9 oscillation circuit connection example fig 27.-1 hi g h-fre quency oscillation connection fig 27-2 low-frequency oscillation connection (note)the load value of the oscillator is the sum of loads (c1 and c2) and the floating load of the actual assembled board. there is a possibility of operating error when using c1 and c2 values in the table below. when designing the board, design the minimum length pattern around the oscillator. we also recommend that oscillator evaluation be carried out using the actual board. the tx03 has been evaluated by the oscillator v ender below. use this information when selecting external parts. 27.9.1 ceramic oscillator the tx03 recommends the high-frequency oscilla tor by murata manufacturing co., ltd. please refer to the following url for details. http://www.murata.co.jp 27.9.2 crystal oscillator the tx03 recommends the high-frequency osc illator by kyocera kinseki corporation. please refer to the following url for details. http://www.kinseki.co.jp x1 c1 c2 x2 rd xt1 c1 c2 xt2
27 electrical characteristics tmpm380/382 tmpm380/382 - 18 / 21 - ? 27.10 handling precaution 27.10.1 solderability of test conditions test parameter test condition note use of sn-37pb solder bath solder bath temperature = 230 c, dipping time = 5 seconds the number of times = one, use of r-type flux solderability use of sn-3.0ag-0.5cu solder bath solder bath temperature = 245 c, dipping time = 5 seconds the number of times = one, use of r-type flux pass: solderability rate until forming 95% ? ? ? ?
tmpm380/m382 tmpm380/m382 - 19 / 21 - ?? ? ? 27.11 note the power on 27.11.1 using power on reset only table 27.1 warming-up time and rising time of power line (por only) symbol rating min typ. max unit t pwup warming-up time after reset released 2 13 /f osc s t dvdd rising time of power line 0.6 ms (note) vdds are dvdd5, rvdd5, avdd5. fig 27-3 power on sequence (using por only) 4.0v power on detection signal power on reset signal power on counter ?? voltage vdds vporh internal reset signal
27 electrical characteristics tmpm380/382 tmpm380/382 - 20 / 21 - ? 27.11.2 using external reset (1) in case of the time of external reset shorter than por (note) vdds are dvdd5, rvdd5, avdd5. fig 27-4 power on sequence (using por and external reset)(1) (2) in case of the time of external reset longer than tpwup (note) vdds are dvdd5, rvdd5, avdd5. fig 27-5 power on sequence (using por and external reset)(2) 4.0v power on counter ?? voltage vdds vporh reset -------------------------- pin internal reset signal depend on 4.0v ?? voltage vdds vporh depend on the time of exterenal reset power on detection signal power on reset signal power on counter reset -------------------------- pin internal reset signal power on detection signal power on reset signal
tmpm380/m382 tmpm380/m382 - 21 / 21 - ?? ? (3) in case of the rising time of power line longer than tpwup (note) in this case, must be reset from reset ------------------------------ pin . (note) vdds are dvdd5, rvdd5, avdd5. fig 27-6 power on sequence (tdvdd > tpwup) ? ? 4.0v power on reset signal power on counter ?? voltage vdds vporh vdds must reach operating voltage and after 200 s, external reset can released. power on detection signal reset -------------------------- pin internal reset signal
tmpm380/m382 tmpm380/m382 - 1 / 5 - 28 package type lqfp100-p-1414-0.50h dimensions unit : mm
28 package tmpm380/m382 tmpm380/m382 - 2 / 5 - pin detail ?6;,??e ? for more dimensional information, please contact any one of our representatives ? ?6;,?e ? the package is palladized ?
tmpm380/m382 tmpm380/m382 - 3 / 5 - ? type qfp100-p-1420-0.65q ? dimensions unit : mm ?
28 package tmpm380/m382 tmpm380/m382 - 4 / 5 - pin detail ?6;,?e? for more dimensional information, please contact any one of our representatives ? ?6;,e? the package is palladized ?
tmpm380/m382 tmpm380/m382 - 5 / 5 - type qfp64-p-1414-0.80c +0.08 ? 0.04 qfp64-p-1414-0.80c unit: mm ?6;,??e ? for more dimensional information, please contact any one of our representatives ? ?6;,?e ? the package is palladized ? dimensions pin detail unit : mm ?
tmpm380/m382 tmpm380/m382 1-1 restrictions on product use ? toshiba corporation, and its subsidiaries and affiliates (collect ively ?toshiba?), reserve the right to make changes to the in formation in this document, and related hardware, software a nd systems (collectively ?product?) without notice. ? this document and any information herein may not be reproduc ed without prior written permission from toshiba. even with toshiba?s written permission, reproduction is permissible only if reproduction is without alteration/omission. ? though toshiba works continually to improve product's quality a nd reliability, product can malfunction or fail. customers are responsible for complying with safety standards and for prov iding adequate designs and safeguards for their hardware, software and systems which minimize risk and avoid sit uations in which a malfunction or failure of product could cause loss of human life, b odily injury or damage to property, including data loss or corruption. before customers use the product, create designs including the product, or incorporate the product into their own applications, customers mu st also refer to and comply with (a) the latest versions of all relevant toshiba information, including without limitation, this document, the specificati ons, the data sheets and application notes for product and the precautions and condi tions set forth in the "toshiba semiconductor reliability handbook" and (b) the instructio ns for the application with which the product will be used with or for. customers are solely responsible for all aspects of their own product design or applications, including but not lim ited to (a) determining the appropriateness of the use of this product in such des ign or applications; (b) evaluating and dete rmining the applicability of any information contained in this document, or in charts, dia grams, programs, algorithms, sample application circuits, or any other referenced document s; and (c) validating all operating paramete rs for such designs and applications. toshiba assumes no liability for customers' product design or applications. ? product is intended for use in general el ectronics applications (e.g., computers, personal equipment, office equipment, measur ing equipment, industrial robots and home electroni cs appliances) or for specif ic applications as expre ssly stated in this document . product is neither intended nor warranted for use in equipment or systems that require extraordinarily high levels of quality a nd/or reliability and/or a malfunction or failure of which may cause loss of human life, bodily injury, serious property damage or se rious public impact (?unintended use?). unintended use includes, without limit ation, equipment used in nuclear facilities, equipment used in the aerospace industry, medical equipment, equi pment used for automobiles, trains, ships and other transportation, traffic signalin g equipment, equipment used to control combustions or explosions, safety dev ices, elevators and escalato rs, devices related to el ectric power, and equipment used in finance-related fi elds. do not use product for unintended us e unless specifically permitted in thi s document. ? do not disassemble, analyze, reverse-engineer, alter, modify, translate or copy product, whether in whole or in part. ? product shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable laws or regulations. ? the information contained herein is pres ented only as guidance for product use. no re sponsibility is assumed by toshiba for an y infringement of patents or any other intellectual property rights of third parties that may result from the use of product. no license to any intellectual property right is granted by this document, whether express or implied, by estoppel or otherwise. ? a bsent a written signed agreement, except as provid ed in the relevant terms and conditions of sale fo r p roduct, and to the maximum extent allowable by law, toshiba (1) assumes no liability whatsoever, including without limitation, indirect, co nsequential, special, or incidental damages or loss, including without limitation, loss of profit s, loss of opportunities, business interruption and loss of data, and (2) disclaims any and all express or implied warranties and conditions related to sale, use of product, or information, including warranties or conditions of merchantability, fitness for a particular purpose, accuracy of information, or noninfringement. ? do not use or otherwise make available product or related so ftware or technology for any m ilitary purposes, including without limitation, for the design, development, use, stockpiling or manufacturing of nuclear, chemical, or biological weapons or missile technolog y products (mass destruction weapons). product and related softwa re and technology may be controlled under the japanese foreign exchange and foreign trade law and the u.s. export administration regulations. export and re-export of product or related softw are or technology are strictly prohibited except in comp liance with all applicable export laws and regulations. ? please contact your toshiba sales representative for details as to environmental matters such as the rohs compatibility of pro duct. please use product in compliance with all applicable laws and regula tions that regulate the inclusion or use of controlled subs tances, including without limitation, the eu rohs directive. toshiba assumes no liability for damages or losses occurring as a result o f noncompliance with applicable laws and regulations.


▲Up To Search▲   

 
Price & Availability of TMPM380FWDFG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X